Skip to content

lagartoflojo/minijq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

minijq

A mini version of jQuery, implementing just a subset of its functions.

API

First, query elements with document.querySelector / document.querySelectorAll:

var el = document.querySelector('div');

Then, you can use the following functions:

// Add `some-class` to the element
el.addClass('some-class');

// Remove `some-class` from the element
el.removeClass('some-class');

// Add `some-class` if the element doesn't have it, remove it if it does
el.toggleClass('some-class');

// Check whether the element has the class `some-class`
el.hasClass('some-class');

// Call someFunction when `some-event` is triggered on the element
el.on('some-event', someFunction);

About

A mini version of some jQuery functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published