mercredi 22 juin 2016

Bootstrap data-toggle="toggle" checked,unchecked by jquery

i'm using bootstrap checkbox with data-toggle="toggle" attribute. I want to set it checked and unchecked with jquery. I tried many ways but it didn't work. Here is my code.

<input type="checkbox" data-toggle="toggle" data-size="small" id="checkbox1">

for button click

$("#checkbox").attr('checked',true);

But it's working when i remove data-toggle="toggle" attribute

Any help is greatly appreciated!

Thanks,




Aucun commentaire:

Enregistrer un commentaire