jQuery – How to Tell if a Checkbox is Checked

Quite often, I find myself in a situation where I need to change the content of a form based on which checkboxes or radio buttons in a group are checked. I used to do this by adding an onclick and/or onchange event to each individual checkbox or radio button and then running a function to figure out whether or not the changed element was checked.

Then, I discovered how easy it is to do all of this on-the-fly with jQuery.