The toggle()
method toggles the presence of a class name in the element's class list. If the class is present, it is removed; if it is absent, it is added.
Description
public ClassList::toggle(string $value): static
Parameters
value
The class name to toggle in the list.
Return Value
Returns the current instance (static
), allowing for method chaining.
Exceptions
None