In jquery what does $('<div></div>') do? -
i implementing jqueryui modal dialog box , related blog showed way of implementing worked don't understand $("<div></div>") doing. creating blank div element use? safe way of implementing this?
it's equivalent document.createelement('div').
you can @ jquery source. comment:
// handle html strings and you'll see how works.
the <div> created empty, has no attributes, , not attached dom.
it's more common see written as:
$('<div />') ...but not functionally different.
often it's chained method appendto(), insert dom.
Comments
Post a Comment