I have a page with 5 sets of form fields. Each field set has a checkbox that if checked will allow users to utilize it. I want to clear the given field set when the user un-checks the check box. As you can see in the code below this method will make for a very long and cluncky script, I would like to make it more generic. If someone could point me in the right direction I would greatly appreciate it.

function clear() {
window.document.roles.foo1.checked = '';
window.document.roles.foo2.checked = '';
<input onClick="clear();"type="checkbox" class="checkBox" />
<input checked name="foo1" type="checkbox" class="checkBox" />
<input checked name="foo2" type="checkbox" class="checkBox" />