classList.js is a cross-browser JavaScript shim that provides the standard element.classList interface where it is missing or incomplete. It lets developers manipulate CSS class names through a token-based API instead of manually editing className strings. The implementation includes methods for adding, removing, checking, toggling, replacing, and retrieving individual class tokens. It also normalizes partial native implementations that accept only one token or lack the forced-state argument for toggle. The script works in nearly all historical browsers except Internet Explorer 7 and earlier. Its small standalone and minified builds make it suitable for legacy sites that need consistent DOM class handling without a framework.

Features

  • CSS class addition and removal
  • Class token presence checks
  • Optional-state class toggling
  • Class token replacement
  • Multiple-token method support
  • Normalization of incomplete native implementations

Project Samples

Project Activity

See All Activity >

Categories

Libraries

Follow classList.js

classList.js Web Site

Other Useful Business Software
Build Agents and Models on One Platform Icon
Build Agents and Models on One Platform

Everything you need to build production-ready agents and models. Access 200+ Google and third-party AI models and tools.

Gemini Enterprise Agent Platform is Google Cloud's comprehensive platform for developers to build, scale, govern, and optimize agents and models. Choose from Google's most advanced models and third-party models like Anthropic's Claude Model Family.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of classList.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Libraries

Registered

2026-07-14