Zen Coding style, declarative DOM tree generator.
Creating a node of a particular type:
var header = zen('header');
var div1 = zen('div');
var div2 = zen();
Specifying IDs:
var logo = zen('div#logo');
// tag name can be omitted, in which case the node you
// create will be a div.
var heading = zen('#heading');
Specifying classe(s):
var item = zen('li.item');
How about attributes?
var link = zen('a[href=https://google.com][title=Google Search]');
You can specify the content(as HTML) of the node as well:
var p = zen('p{lorem ipsum}');
- Repitition:
zen('li.item*5')
- Auto-Indexing:
zen('li.item{item $}')
- Appending Children:
zen('ul', zen('li*5{item $}'))
- Better Documentation
(MIT)