Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:46:46+00:00 2026-05-15T08:46:46+00:00

The reason is that we can do $(‘<div>some text</div>’).prependTo(‘#someDiv’) so, this is also ok

  • 0

The reason is that we can do

$('<div>some text</div>').prependTo('#someDiv')

so, this is also ok to do:

$('some text').prependTo('#someDiv')

but we can’t change some text to body? body is just as good as any text…

(the above code is adding some text to the div with id someDiv, so what if I want to add the word body to the div?)

but $(‘body’) becomes a selector for the body element… so is there a rule that says, we can use any text as HTML code, so long as it is not the name of HTML elements?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:46:47+00:00Added an answer on May 15, 2026 at 8:46 am

    Basically this is never valid:

    $('generic text here, *not* a selector or HTML');
    

    That should always be either a selector (finding an element) or html (creating element(s)), you can view the API for $() here.

    You want to use one of the other DOM Insertion methods here, .prepend() in this case:

    $('#someDiv').prepend('any text or html here is valid, <b>Hey look bold</b>.');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was told that for some reason, you can't update a database schema when
Hullo, For some reason (that I can't work out) a function that returns an
I'm having some problems tracing the reason that I can't load a java(fx) applet.
I tired my hands on bazaar(launchpad), for the reason that i can host my
What is the reason that in Java, a member with a protected modifier can
This is probably a dumb question, but I can't find a definitive answer anywhere.
Is it generally acceptable that one repository can access another repository? Specifically in this
I'm looking for a C++ libraries that can work with Visual Studio 2008/2010, but
Is there a specific reason that the EF requires new data providers and can't
I need advice regarding subselect performance in MySQL. For a reason that I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.