Categories
JavaScript

Mutually exclusive checkboxes

Sometimes it’s just not worth arguing. Super quick and nasty solution to a request for checkboxes that are mutually exclusive: one or no checkboxes can be selected. I know, I know; radio selector, right? Some HTML: <fieldset> <label for=”ResponseSaidCBY”>Yes</label> <input type=”checkbox” id=”ResponseSaidCBY” /> <label for=”ResponseSaidCBN”>No</label> <input type=”checkbox” id=”ResponseSaidCBN” /> </fieldset> and some JavaScript: function clickYes() […]