Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
/ element-classlist Public archive

Polyfill for classList attribute (DOMTokenList interface)

License

Notifications You must be signed in to change notification settings

plusdude/element-classlist

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published