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.
For any types of queries, you can contact us on info[at]namasteui.com.
Facing Google penalties can be a daunting challenge for businesses relying on organic search traffic.…
Technology, undeniably, has made our lives easier. But the advent of artificial intelligence has been…
Guest post services have become an essential tool for businesses and individuals looking to increase…
Programming continues to evolve at a rapid pace, with new trends and technologies emerging every…
Let’s be honest; a startup business hardly has sufficient amount to promote their services and…
Introduction In today's digital age, having a strong online presence is crucial for businesses in…