Now you can simply turn your HTML code to vanilla JavaScript document.createElement instances to make your HTML dynamic and accessible by JS on-the-fly
- Move the htmltojs.js to your directory.
- Pass your HTML to gen() function:
gen('<h1 class="test">Example</h1>')
- Or just use a live generator: https://kvlk-dev.github.io/html-to-js/