2010-10-21 76 views

回答

2
if($('input:checked').length >= 2) { 
    $('div').show(); 
} 
2

的jQuery:

$('input[type=checkbox]').change(function(){ 
     if($('input:checked').size() > 1){ 
     $("div").show(); 
    } 
    else { 
     $('div').hide() 
    } 
}) 

HTML:

<input type="checkbox" id="one"></input> 
<input type="checkbox" id="one"></input> 
<input type="checkbox" id="one"></input> 
<div style="display: none;">At least 2 are checked</div> 

Try it!

+0

它解決了我的問題,謝謝!你是最棒的! – SASHI 2010-10-22 07:53:09