Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
jQuery

Checkbox Handling in jQuery

Read/write checked state and gather selected checkbox values.

Checkbox Handling in jQuery — a practical guide to jQuery checkbox with clear examples you can reuse in real projects.

jQuery Tutorial Series (60/101). Prefer one article? Read the complete jQuery tutorial.

Short description

Use .prop("checked") not .attr("checked") for current state.

Checkbox

$('#terms').prop('checked', true);
var skills = $('input[name="skills"]:checked').map(function () {
  return $(this).val();
}).get();

Leave a reply

Your email address will not be published. Required fields are marked *