Skip to content

Simple library to create DOM elements really fast with chaining.

Notifications You must be signed in to change notification settings

crfroehlich/ThinDOM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThinDOM: a thin DOM wrapper

Inspired by jQuery, this simple library lets you create DOM elements really fast, with significantly more expressiveness than native DOM methods.

How fast? Super fast.

Usage


captionDOM = ThinDOM div 
  .attr 'class', 'caption'
  .append ThinDOM 'div' 
  .attr 'class', 'votes'
  .append ThinDOM 'a' 
  .attr 'class': 'up', 'href': '#'
  .append ThinDOM 'a' 
  .attr 'class': 'down', 'href': '#'
  .append ThinDOM 'div'
  .attr 'class', 'meta'
  .append ThinDOM 'span'
  .text author + ' - '
  .append ThinDOM 'span'
  .text points + ' point' + plural
  .append ThinDOM 'p' 
  .html body 
  .get() 

About

Simple library to create DOM elements really fast with chaining.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 49.2%
  • CoffeeScript 30.9%
  • HTML 19.9%