This is not meant to replace your templating engine. This is meant to help with times templating engines, or html is not available, like in a browserify ui component. Eg.
// beforevar buttons = documentuse = documentcancel = document;buttonsclassName = 'button-group';usetextContent = 'use';canceltextContent = 'cancel';buttons;buttons;use;cancel;// with domlavar dom =div = domdivbutton = dombuttonbuttons;buttons =;
Domla has a ton of methods. Pretty much all of which are tagNames of elements. See available. Eg.
var dom =div = domdiv;; // < DIV > element
To add attributes pass in an object as the first argument.
;// <div class="foo" style="box-sizing:border-box;"></div> plus a event listener
Important to note that you should use
Next you might want to string multiple elements together.
; // appends span to div
This allso works with text
var el =;// add it to the pagedocumentbody;
Have fun with it and file any bugs you find.