1.0.4 • Published 2 years ago
doc-shorter v1.0.4
doc-shorter
npm install doc-shorter
import docShorter from 'doc-shorter';
const doc = new docShorter();
//querySelector
doc.q('#id');
doc.q('.classname');
//querSelectorAll
doc.qAll('.btn');
// getElementById
doc.id('id');
// getElementByClassName
doc.c('classname');
// getElementByTagName
doc.t('tagname');
// addEventListener
const el = doc.q('#id');
function callback(e) {
console.log(e.target);
}
doc.listen(el, 'click', callback);