This small library offers a way to dynamically create HTML elements using tag names as functions.
Check the demonstration page to learn how it works.
- The library uses a
Proxy, so the element functions are lazy loaded (on demand). - address the
classNameproperty as{class: ...} - address
data-attributesas{data: {one: '...', ...}} - address
innerHTML/textContentas{html: ...}or{text: ...} - tag function names are case insensitive
(e.g.
tags.DIVortags.div,const {h3, H3, DIV, p, P} = tags)
Enjoy!
For a more comprehensive DOM helper, check my JQuery alike module (JQL).