jQuery: Check / uncheck form checkbox and radio

by Yang Yang on April 16, 2009

Using both attr() and removeAttr() functions, it’s actually the same as enabling and disabling form controls with jQuery.

$("#option").attr("checked", "checked"); // make checkbox or radio checked
$("#option").removeAttr("checked"); // uncheck the checkbox or radio

Subscribe to Kavoir: blog feed

You should also read:

{ 13 comments… read them below or add one }