<script>
$(document).ready(function(){
$('input[type=checkbox]').click(function(){
$(this).attr('disabled','disabled');
if($("input[name='c']:checked").length >=3)
{
$("input[name='c']").attr('disabled','disabled');
}
});
$("#count").click(function(){
$('input').live('click',function(){
alert($('input:checked').length);
});
});
})
</script>
<body>
<input type="checkbox" name="c"/>1
<input type="checkbox" name="c"/>2
<input type="checkbox" name="c"/>3
<input type="button" id="count" value="有多少CheckBox被选中了?" />
</body>