Skip to content

x0a/html-to-js-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Converts HTML to ES6-compatible functional javascript.

Sample input:

<nav class="navbar navbar-light bg-light">
  <span class="navbar-text">
    Navbar text with an inline element
  </span>
</nav>

Produces sample output:

(() => {
    let el = document.createElement("nav");
    el.setAttribute("class", "navbar navbar-light bg-light");
    el.appendChild((() => {
        let el = document.createElement("span");
        el.setAttribute("class", "navbar-text");
        el.appendChild(document.createTextNode("Navbar text with an inline element"));
        return el;
    })());
    return el;
})();

About

Converts HTML to ES6 compatible javascript elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published