html-forge

create-elements

Usage no npm install needed!

<script type="module">
  import htmlForge from 'https://cdn.skypack.dev/html-forge';
</script>

README

HTML Forge

Work with HTML Elements. Show them who's boss.

const div = createElement({
  tag: string,                // Optional - Default 'div'
  id: string,                 // Optional
  innerHTML: string,          // Optional
  innerText: string,          // Optional
  className: string,          // Optional
  cssText: string,            // Optional
  events: { ...DOMEvents },   // Optional
  styles: { ...CSSStyles },   // Optional
})

document.body.appendChild(div)