eleminate
Function to create DOM elements.
Using eleminate
// must provide document object to use eleminate function// Note: use browserify or include lib/eleminate.js for browser environmentvar el = document; // create empty elementvar br = ; // create element with text contentvar span = ; // create element with attributes setvar section = ; // create element with text and attributesvar anchor = ; // create element with childrenvar ul = ; // pass text with children to act as delimitervar nav = ; // hyphens between links
Namespaces
If you need to use namespaces, register the namespace prefix when creating the
eleminate
function and pass the appropriate qualified name when calling the
eleminate
function.
var el = document // this is actually unnecessary because svg is predefined svg: "http://www.w3.org/2000/svg" ; var icon =
The following namespaces are predefined, so you don't need to register them. If for some reason you want to override any of them, just pass the namespace as normal to register the override.
- html: http://www.w3.org/1999/xhtml
- mathml: http://www.w3.org/1998/Math/MathML
- svg: http://www.w3.org/2000/svg
- xlink: http://www.w3.org/1999/xlink
- xml: http://www.w3.org/XML/1998/namespace
- xsl: http://www.w3.org/1999/XSL/Transform
- xmlns: http://www.w3.org/2000/xmlns/
- soap: http://schemas.xmlsoap.org/wsdl/soap/
- wsdl: http://schemas.xmlsoap.org/wsdl/