gitbrent/bootstrap4-toggle

event via jquery

FrederickD opened this issue · 1 comments

Hello,

I try to adjust swtich state trough JQuery but can't make it to work:

if(data['wallweaponcheck'] == "1") { document.getElementById("wallweaponcheck").bootstrapToggle('on'); };

What is wrong here?

ok, solved.

Needed to be: $("#wallweaponcheck").prop('checked', true).change();