A minimal DOM Library built on top of prime.
Overview
var $ = require('elements');
var ready = require('elements/domready');
var zen = require('elements/zen');
ready(function() {
var element = zen('div#someID.className');
element.text('read the documentation').insert(document.body);
element.on('click', function() {
console.log('clicked!');
});
var document = $(document);
if (document.find('div#someID.className') === element) {
console.log('success!');
}
document.delegate('click', 'div#someID', function() {
console.log('delegation is nice');
});
element.addClass('className2');
});
When all else fails, read the full documentation.