/ Published in: jQuery
this is a shortcut that simplifies making a new dom element.
$("#outerdiv").append(
create("div").addClass("innerDiv").text("This is the inner div")
)
$("#outerdiv").append(
create("div").addClass("innerDiv").text("This is the inner div")
)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
create = function(elementTagName) { return $(document.createElement(elementTagName)); }