prime dom library

npm install elements
39 downloads in the last day
166 downloads in the last week
1 070 downloads in the last month


Build Status

A minimal DOM Library built on top of prime.


// require elements
var $ = require('elements');

// require elements utilities
var ready = require('elements/domready');
var zen = require('elements/zen');

// do this on domready
ready(function() {

  // create an element with css syntax
  var element = zen('div#someID.className');

  // add text and insert into body
  element.text('read the documentation').insert(document.body);

  // add an event listener for click
  element.on('click', function() {

  var document = $(document);

  // find the element in the dom, it's the same elements instance!
  if (document.find('div#someID.className') === element) {

  // delegate click, because delegation is best
  document.delegate('click', 'div#someID', function() {
    console.log('delegation is nice');

  // finally add a class name


When all else fails, read the full documentation.

npm loves you