Deprecated
I recommend Mithril.js instead.
A tiny JavaScript framework for building UI with minimal overhead.
Example
Following JavaScript...
select(["head", "get", "post"])
will generate following HTML.
<select>
<option value="head">head</option>
<option value="get">get</option>
<option value="post">post</option>
</select>
To add inline style...
js
select(["head", "get", "post"], {
style: { textTransform: "uppercase" }
})
html
<select style="text-transform: uppercase">
<option value="head">head</option>
<option value="get">get</option>
<option value="post">post</option>
</select>
To add generated element to document...
const methodType = select(["head", "get", "post"], {
style: { textTransform: "uppercase" }
})
document.body.appendChild(methodType);
or shorthand version
select(["head", "get", "post"], {
style: { textTransform: "uppercase" }
}, document.body)