Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Qlass.js

=====

A library for performing common classy functions on elements and collections.

Usage

<div id="main" class="content js"></div>

q(document.getElementsByTagName('div')).addClass('new-class');

var main = document.getElementById('main');

if (q(main).hasClass('js')) {
	q(main)
		.addClass('css')
		.removeClass('content');
}

Use q() as the wrapper and pass it any Element or HTMLCollection of elements that you want to add, remove or check if they have a class.

q(elem).addClass('string')
q(nodes).hasClass('string')
q(el).removeClass('string')

If there is no element or nodelist selected it will return this back after checking for a null element or nodelist length of 0.

About

Micro library for addClass() hasClass() removeClass() with Elements and NodeLists

Resources

License

Releases

No releases published
You can’t perform that action at this time.