bonze

bonze

Hit your DOM the smart way

Super tiny chainable and extendable tool wrapping native querySelectorAll for selecting, creating and filtering DOM Elements.


          

        
$(selector)
CSS string, context, array of selectors, HTML string creation.
.first() .last()
Target the first or last element of the current selection.
.nth(n)
Target the nth element by zero-based index.
.odd() .even()
Filter to odd or even indexed elements.
.filter(fn)
Filter elements using a custom predicate function.
.siblings()
Get all sibling elements sharing the same parent node.
.back()
Return to the previous selection state in the chain.
.set(fn)
Morph the current element collection via a transform function.
(callback) .each
Iterate over elements with a callback. The core mechanic.
$.plugin()
Extend bonze with custom reusable methods on all instances.