Sometimes, we want to create a toggle button in Bootstrap.
In this article, we’ll look at how to create a toggle button in Bootstrap.
How to create a toggle button in Bootstrap?
To create a toggle button in Bootstrap, we add the data-toggle
attribute to a button.
For instance, we write
<button type="button" class="btn btn-primary" data-toggle="button">
Single toggle
</button>
to add data-toggle="button"
into the button to make the button a toggle button with Bootstrap.
Conclusion
To create a toggle button in Bootstrap, we add the data-toggle
attribute to a button.