by
v0.2.3
Published
Select elements by class or id or tag
Downloads
446
Readme
by
Select elements by class or id or tag
Example
Because document.getElementsByClassName
is simply too verbose.
var byClass = require("by/class")
, queryAll = require("by/queryAll")
var elems = byClass("some-class")
var other = queryAll(".some div.selector", elems[0])
Also has
var byName = require("by/name")
which is short fordocument.getElementsByName
var byId = require("by/id")
which is short fordocument.getElementById
var query = require("by/query")
which is short fordocument.querySelector
var queryAll = require("by/queryAll")
which is short fordocument.querySelectorAll
var byTag = require("by/tag")
which is short fordocument.getElementsByTagName
Installation
npm install by
Contributors
- Raynos