I can get the bootstrap toggle working by using HTML, but cannot do it using the Javascript API method. Basically, first toggle button works, but the second one written using the API method just shows up as a checkbox. Appreciate your help clarifying what I am missing in my code:
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<input type="checkbox" data-toggle="toggle" data-on="Enabled" data-off="Disabled">
<input type="checkbox" id="toggle-two">
<script>
$(function() {
$('#toggle-two').bootstrapToggle({
on: 'Enabled',
off: 'Disabled'
});
})
</script>
Thanks!
I figured out the answer. The function() was not necessary to have in my code: