Bootstrap toggle-switch is a simple component used for activating one of the two given options. Commonly used as an on/off button.
- Bootstrap has an inbuilt data-toggle attribute that is used for toggling Bootstrap elements.
- Here bootstrapToggle() method is used for performing the task. The bootstrapToggle() method enables the toggling of the switch. If the switch is disabled and the user clicks the checkbox then it toggles to an enabled state. If the checkbox is in the enabled state then the bootstrapToggle() method toggles it to the disabled state.
- Here, the toggleOn() method toggles on the switch whereas toggleOff() method toggles off the switch.
- Include Bootstrap in AngularJS using ng-bootstrap
- Difference between bootstrap.css and bootstrap-theme.css
- Difference Between Bootstrap 3 and Bootstrap 4
- Difference between Bootstrap 4 and Bootstrap 5
- How to add image before optgroup label using Bootstrap ?
- How to add a black hover to an image using bootstrap?
- How to add active class on click event in custom list group in Bootstrap 4 ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.