add, remove, toggle and contains for CSS classes.
- Category: JS DOM — part of the JavaScript Tutorial on GoCareerGo
- Read the short summary above, then check the linked docs for full syntax/behaviour
- Interview tip: be ready to explain "classList API" in one sentence, then back it up with a tiny example
// classList API — minimal example
console.log("classList API");Tip
Quick recall: "classList API" — add, remove, toggle and contains for CSS classes.