What does the selector syntax mean in this code? I\'ve seen selectors like
div
or #someId
but I\'m confused what the
It means "create a jQuery-wrapped div element on the fly".
See http://api.jquery.com/jQuery/
From the above:
jQuery( html [, ownerDocument] )
Description: Creates DOM elements on the fly from the provided string of raw HTML.
Later...
When the parameter has a single tag, such as
$('
or')
$('')
, jQuery creates the element using the native JavaScriptcreateElement()
function.
So basically, it's like doing:
$(document.createElement("div")).text("blahblah");