Is it possible to remove the input type checkbox checked attribute on click of id="chk1" checkbox.
<div class="index1" id="test1">
<h2>testing1</h2>
<div class="str">
<ul>
<li class="nvc1">
<input type="checkbox" value="in1" id="chk2" checked="checked" />
<div class="checkbox-select">str1</div>
<div class="checkbox-deselect">str2</div>
</li>
</ul>
</div>
</div>
<div class="index2" id="test2">
<h2>testing2</h2>
<div class="string">
<ul>
<li class="nv1">
<input type="checkbox" value="in1" id="chk1" />
<div class="checkbox-select">lblstr1</div>
<div class="checkbox-deselect">lblstr2</div>
</li>
</ul>
</div>
</div>
Is there any reference for this/
Thanks, ShailShin
I suggest this:
$("#chk1").on("change", function(){
$("#chk2").prop("checked", !$(this).prop("checked"));
});
Change #chk2 checked status depend on #chk1.
JSFiddle
In JQuery you can use:
jQuery('#chk1').click(function()
{
jQuery('#chk1').removeAttr('checked');
});
But does it makes sense? :-)
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