这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 25, 2021. It is now read-only.

mov37/zen.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

zen.js

Zen Coding style, declarative DOM tree generator.

Usage

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}');

TODO

  • Repitition: zen('li.item*5')
  • Auto-Indexing: zen('li.item{item $}')
  • Appending Children: zen('ul', zen('li*5{item $}'))
  • Better Documentation

License

(MIT)

Bitdeli Badge

About

Zen Coding style, declarative DOM tree generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published