Skip to content

markrendle/moist.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

moist.js

Just a really lightweight way of specifying HTML as JavaScript objects, so you don't get all kinds of messy markup strings inside your JS, and you don't have to manipulate the DOM directly which is slooooow.

Usage

This:

Moist.html({div:[]});

produces

<div></div>

This:

Moist.html({div:["Moist!"]});

produces

<div>Moist!</div>

This:

Moist.html({div:[{h1:["Moist!"]}], id: "main", _class: "container"});

produces

<div id="main" class="container"><h1>Moist!</h1></div>

Check out the tests for more info.

About

Write HTML as JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published