rkgttr-q
DOM elements selector shortcuts.
How to Install
$ npm install rkgttr-q --save-dev
or
$ yarn add rkgttr-q --dev
Getting Started
Q is a module that consists of shortcuts to select DOM elements. For example instead of typing document.querySelectorAll('selector')
you just have to type Q.all('selector')
. Following is the list of Q methods:
one
: shortcut fordocument.querySelector
all
: shortcut fordocument.querySelectorAll
id
: shortcut fordocument.getElementById
classname
: shortcut fordocument.getElementsByClassName
tag
: shortcut fordocument.getElementsByTagName
All methods, except Q.id
can have a second optional parameters, which should be a Node
object, that is the context from where you want to perform the query. For example:
; Qall'li'; // return all list elements in the documentQall'li' Q; // return all list elements into the .todo list
License
MIT © 2016 Erik Guittiere