Used for personal projects/simple apps with little DOM interactions.
Minified version: 6kb
Gziped version: 2kb
UMD ready. It can be loaded via AMD, CommonJs and as global namespace.
define(['nojquery'], function(NoJQuery){
var $$ = NoJQuery;
});
var $$ = require('nojquery');
var $$ = window.NoJQuery;
var result = $$('selector').find('child-element');
console.log(result.elmts[0]);
$$('selector').addClass('some-class');
var bool = $$('selector').hasClass('some-class');
console.log(bool);
$$('selector').removeClass('some-class');
var result = $$('selector').contains('some-selector');
console.log(result);
$$('selector').empty();
$$('selector').text('Hello');
$$('selector').html('<a href="/" > Link </a>');
var result = $$('selector').getAttr('attrName');
console.log(result);
$$('selector').setAttr('readonly', 1);
$$('selector').removeAttr('readonly');
$$('selector').remove();
var result = $$('selector').next();
console.log(result.elmts[0]);
var result = $$('selector').prev();
console.log(result.elmts[0]);
$$('selector').append('<div>Hello</div>');
$$('selector').append($$('selector-elmt'));
$$('selector').prepend('<div>Hello</div>');
$$('selector').prepend($$('selector-elmt'));
function onButtonClick(evt) {
console.log('click', evt.currentTarget);
};
$$('selector').on('click', onButtonClick);
$$('selector').off('click', onButtonClick);