The correct way to check checkbox on the DOM elements can be done using jQuery .prop or .attr method.
By using JavaScript’s “checked” property, we can solve the problem directly, instead of manipulating the DOM into doing what we want it to do.
After jQuery version 1.6 you can use:
$('.chkID').prop('checked', true);
$('.chkID').prop('checked', false);
And jQuery version 1.5x and below you can use:
$('.chkID').attr('checked', true);
$('.chkID').attr('checked', false);
Read: jQuery Checkbox checked property
This plugin will alter the checked property of any DOM elements selected by jQuery, and successfully check or uncheck checkboxes under all circumstances.
In a world where digital presence is paramount, the question isn't whether you should do…
Over the years, people have experimented with various methods to maintain healthy and beautiful hair.…
Your brand more than developing an attractive and creative logo and infectious motto. It's the…
Introduction Are you someone who has suffered from a personal injury and want to file…
Operating from home has emerged as one of the most popular ways of doing jobs…
If the consequences of our society’s ever-growing debt are what worries you, then it is…