Skip to content
This repository was archived by the owner on Sep 13, 2021. It is now read-only.

Repository files navigation

About

Implementation of classList attribute (DOMTokenList interface). Depends on Array Generics.

Examples

var element = document.documentElement;

// add class
element.classList.add("root");

// remove class
element.classList.remove("root");

// toggle class
element.classList.toggle("root");

// test class
element.classList.contains("root");

Usage

Just include into your document:

<script src="path_to/array.generics.min.js"></script>
<script src="path_to/element.classlist.min.js"></script>

Notes

  • Browsers that natively supports classList does not pass all tests (at least at the moment).
  • This shim does not work in Internet Explorer versions less than 8.

About

Polyfill for classList attribute (DOMTokenList interface)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages