ThinDOM:瘦 DOM 包装器
受 jQuery 的启发,这个简单的库让您可以非常快速地创建 DOM 元素,其表现力明显高于原生 DOM 方法。
用法
一个完整的例子在。
var captionDOM = new ThinDOM('div').attr('class', 'caption')
.append(new ThinDOM('div').attr('class', 'votes')
.append(new ThinDOM('a').attr({'class': 'up', 'href': '#'}))
.append(new ThinDOM('a').attr({'class': 'down', 'href': '#'})))
.append(new ThinDOM('div').attr('class', 'meta')
.append(new Thin