-4
rated 0 times
[
0]
[
4]
/ answers: 1 / hits: 24161
/ 9 Years ago, tue, february 2, 2016, 12:00:00
I want to toggle the checkbox on click of button.
Here is my jQuery
$(#choose_address2).on(click, function () {
console.log(click!!! address2);
var $checkbox = $(this).find(':checkbox');
var checkBoxes = $(input[name=checkbox]]);
checkBoxes.prop(checked, !checkBoxes.prop(checked));
});
Here is my Input
<span id=choose_address2 class=btn btn-info>
<i class=fa fa-plus-circle></i>เพิ่มที่อยู่
<input type=checkbox name=choose_address {{#if customer.addresses}}checked{{/if}} id=choose_address1 hidden>
</input></span>
By default the button is checked.
however when i click the span with id choose_address2
I want to change the state. Any suggestions will be highly appreciated.
More From » jquery