rkgttr-q
v0.0.7
Published
DOM selector shortcuts.
Maintainers
Readme
rkgttr-q
DOM elements selector shortcuts.
How to Install
$ npm install rkgttr-q --save-devor
$ yarn add rkgttr-q --devGetting 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.querySelectorall: shortcut fordocument.querySelectorAllid: shortcut fordocument.getElementByIdclassname: shortcut fordocument.getElementsByClassNametag: 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:
import * as Q from 'rkgttr-q';
Q.all('li'); // return all list elements in the document
Q.all('li', Q.one('ul.todo')); // return all list elements into the .todo list
License
MIT © 2016 Erik Guittiere
