Skip to content

KooiInc/tinyDOM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinyDOM

Create HTML elements using the element name as a function

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.

Details

  • The library uses a Proxy, so the element functions are lazy loaded (on demand).
  • address the className property as {class: ...}
  • address data-attributes as {data: {one: '...', ...}}
  • address innerHTML/textContent as {html: ...} or {text: ...}
  • tag function names are case insensitive (e.g. tags.DIV or tags.div, const {h3, H3, DIV, p, P} = tags)

Enjoy!


For a more comprehensive DOM helper, check my JQuery alike module (JQL).

About

A small html element creation helper library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published