Object2HTML
Convert the following formated object to a HTMLElement
_:'tagname'//defaults to 'div' if not defined attr||a:{}//attributes prop||p:{}//properties event||e:{}//events child||c:/*other objects*///childNodes
Usage
npm i object2html
Then import or require it in your code depends on your environment:
;//orconst Object2HTML = ;
Object2HTML(object[,func]);
- object : The object to be converted to dom element, or a string(will be converted to a text node).
- func : (optional) A function to be called after every element created, the parameter is the element.
Return the dom element.