Skip to content
Advertisement

How to get value of bootstrap switch

I’m using bootstrap switch & i want to get checkbox value on click on switch. I’ve tried this but i din’t get the value. Could you check my code bellow & let me know where i did wrong

JavaScript
JavaScript

Advertisement

Answer

Tamara,

Bootstrap Switch has an onSwitchChange property that will be able to give you the state of the toggle. Please see this fiddle: https://jsfiddle.net/learnwithclyde/to2hng3f/

JavaScript

The above code snippet is how you would implement onSwitchChange property and get the state of the toggle control.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement