Element
This class helps creating DOM elements in a simple way. Element constructor takes 2 argumens: tagName and attributes definition:
Element( tagName [, attributes])
Attributes argument is optional. When it’s passed it should be defined as JavaScript object, like: { attrName : attrValue, …}. Seee example below to understand the principals of working with Element class.
<div id="box"></div>
...
$('box').appendChild(
new Element(
'input',
{
type : 'button',
value : 'Click me',
onclick : 'alert( "Woohoo, I'm clicked!")'
})
);
