I see to get a strange problem in my website which is yogihosting.com. The problem is that jQuery is not running in it. Everything is correct and i have checked them multiple times. Even an alert is not running.
However the code runs when i place it in a simple html file. My website is in WordPress i think that is is some WordPress feature which is not letting it to run. The code is -
I have noticed that their is a bug in jQuery 2.1.4. I have made a code
through which checking a main checkbox checks all the checkbox in the
table. The code works for the first 2 click but does not work from 3 rd
click .
The code works correctly when i use jquery 1.4.3.
You can see the page online at - http://www.yogihosting.com/check-uncheck-all-checkbox-using-jquery/
the jquery code is -
<script type="text/javascript">
$(document).ready(function () {
$("#mainCheckBox").click(function () {
if ($(this).is(":checked")) {
$("#pageTbody").find('input[type="checkbox"]').each(function
() {
$(this).attr("checked", true);
});
}
else {
$("#pageTbody").find('input[type="checkbox"]').each(function
() {
$(this).attr("checked", false);
});
}
});
});
</script>