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

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -