mercredi 5 août 2020

How can I set the bootstrap switcher by default to ON?

I am using the Bootstrap Switcher (https://bttstrp.github.io/bootstrap-switch/examples.html)

<p><input  type="checkbox" checked="checked" data-on-color="info" ></p>

<script src="js/jquery-3.3.1.js"></script>
<script src="js/highlight.js"></script>
<script src="https://unpkg.com/bootstrap-switch"></script>
<script src="js/main_switch.js"></script>

By default it looks like this:

enter image description here

But I would like the switcher to be default switched to ON:

enter image description here

But even if I set it to checked, it is always OFF. I also tried:

<p><input  type="checkbox" data-on-color="info" checked></p>

But no change.

I also tried:

<p><input  type="checkbox" data-on-color="info" checked="true"></p>

but no change




Aucun commentaire:

Enregistrer un commentaire