DOM Doctor
Simple DOM manipulation wrapper.
Usage
var doc = require('dom-doctor');
var app = doc.find('#app');
var data = app.get('data-href', 'data-text', 'data-img');
app.append(doc.fragment(
doc.create('img').set({ src: data['data-img'], width: 200 }),
doc.create('a').set({
href: data['data-href'],
innerHTML: data['data-text'],
style: 'display:block; font-size:1.5em; text-decoration:none;'
})
));
doc
find(query)
findAll(query)
create(tagname)
fragment(...nodes)
node
get(...fields)
set(propsObject)
childNodes()
parent()
clone(deepBool)
append(node)
remove(node)
replace(oldNode, newNode)
insert(node, refNode)