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?