Toggler
Toggler switches a class or an attribute on click, with data attributes only and no custom JavaScript.
Toggle a class
The button toggles the class from data-bs-value on itself.
Remove an existing class
When the element already has the class, the first click removes it.
Target element
Point data-bs-target at another element. The value lives on the target.
The button toggles
bg-primary-lt here.Multiple elements
A selector with many matches toggles every one, each with its own value.
Toggles
bg-blue-ltToggles
bg-green-ltToggles
bg-orange-ltToggle an attribute
Set data-bs-attribute to toggle an attribute instead, here hidden.
Disable a form
Toggle disabled on a fieldset to lock every control inside.