Setting “checked” for a checkbox with jQuery

Modern jQuery Use .prop(): DOM API If you’re working with just one element, you can always just access the underlying HTMLInputElement and modify its .checked property: The benefit to using the .prop() and .attr() methods instead of this is that they will operate on all matched elements. jQuery 1.5.x and below The .prop() method is not available, so you need to use .attr(). Note that this is the … Read more