domjs is a small, lightweight JavaScript class to make adding new nodes to the dom simple. This class uses the Prototype JavaScript library and supports method chaining to assist in creating these elements.
Old Code:
input = document.createElement( 'input' ); input.setAttribute( 'type', 'hidden' ); input.setAttribute( 'id', 'selected' + id ); input.setAttribute( 'name', 'selected_tag[]' ); input.setAttribute( 'value', 'xyz' ); form.appendChild ( input );
New Code:
new DOMElement( 'input' ).
attribute( 'type', 'hidden' ).
attribute( 'id', 'selected' + id ).
attribute( 'name', 'selected_tag[]' ).
attribute( 'value', 'xyz' ).
attach( form );
Commercial Use
Modify
Distribute
Sub-License
Private Use
Hold Liable
Include Copyright
Include License
These details are provided for information only. No information here is legal advice and should not be used as such.