Get and Set Attributes in jQuery — a practical guide to jQuery attr prop with clear examples you can reuse in real projects.
jQuery Tutorial Series (38/101). Prefer one article? Read the complete jQuery tutorial.
Short description
checkbox checked → .prop("checked"); href → .attr("href").
attr / prop
$('a').attr('href', '/home');
$('#agree').prop('checked', true);