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
Ship Agents Faster Icon
Ship Agents Faster

Transform your applications and workflows into powerful agentic systems at global scale.

Gemini Enterprise Agent Platform lets you rapidly build, scale, govern and optimize production-ready agents grounded in your organization's data. The platform enables developers to build custom or pre-built agents for virtually any use case. New customers get $300 in free credits.
Get Started 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