1.0.1 • Published 8 years ago

dom-class-list v1.0.1

Weekly downloads
1
License
CC0-1.0
Repository
github
Last release
8 years ago

Class-list

Utility used to perform CRUD (create, read, update and delete) operations on DOM classes.

Example

HTML

<div id="test-block-a" class="test-class test-class-a">
 	<div id="test-block-b" class="test-class-b" >
		<div id="test-block-c" class="test-class-c"></div>
	</div>
</div>;

JS

var assert = require( 'assert' );
var classList = require( 'class-list' );
var testBlockA = document.getElementById( 'test-block-a' );
assert( classList.contains( testBlockA, 'test-class-b' ), false );
classList.addClass( testBlockA, 'test-class-b' )
assert( classList.contains( testBlockA, 'test-class-b' ), true );

Installation

npm install class-list

Contributing

We welcome your feedback and contributions. See the contribution guidelines for more details.

Additionally, you may want to consider contributing to the Capital Framework, which is the front-end pattern library used in this project.

Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy