The ability to create elements on the fly in a more terse manner, by passing all attributes as the second argument to jQuery()
:
jQuery('<div/>', {
id: 'foo',
mouseenter: function() {
// do stuff
},
html: jQuery('<a/>', {
href: 'http://google.com',
click: function() {
// do stuff
}
})
});
All non-attribute properties map to the corresponding jQuery method. So having html
there will call .html()
and having click
will bind a new click
event via .click()
...