Make function more re-usable
<p>I need to run a function that makes checkboxes behave like radio buttons. I know, long story. Anyway, I want to make it more re-usable and not have to rewrite it for each group. I have it working like this:</p>

<pre><code>$(function() {
    var $apples = $('input.apples');
    $apples.click(function() {
        $apples.removeAttr('checked');
        $(this).attr('checked', true);
    });
});
</code></pre>

<p>How can I make this more global so that if I have another group of checkboxes .bannanas it will work for them as well without having to rewrite it?</p>

<p>thx</p>
