Web APIs

DOMTokenList.remove()

Try the free JavaScript compiler

Remove specified tokens, leaving other tokens untouched. Missing tokens have no effect. Example console output: note.

Formal Syntax & Structure

javascript syntaxjavascript
tokens.remove(...tokensToRemove)

Parameters & Attributes

NameTypeDescription
tokensToRemovestring[]Variadic individual tokens.

Return Value

undefined

No result value.

Working Example

Example Snippetjavascript
const p=document.createElement("p"); p.className="note active"; p.classList.remove("active","missing"); console.log(p.className);
JavaScript Reference