jQuery: make checkboxes act like radio buttons?

$("input:checkbox").click(function(){
    var group = "input:checkbox[name=""+$(this).attr("name")+""]";
    $(group).attr("checked",false);
    $(this).attr("checked",true);
});

This will do it, although i do agree this might be a bad idea.

Online example: http://jsfiddle.net/m5EuS/1/

UPDATE added group separation.

Leave a Comment