I have been trying to use jQuery to uncheck the checkbox if value is = to a variable for instance "test" Example:
<input type="checkbox" name="cbname" value="test" checked="checked" />
Since this one has a value of test i would like it to be unticked, how could i do this?
thanks
var val = 'test';
$('input:checkbox[value="' + val + '"]').attr('checked', false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With