tags:

views:

22

answers:

2

Help me to find out to show a div if two or more check box are checked using JQuery only. Please let me know the very simple one.

+2  A: 
if($('input:checked').length >= 2) {
   $('div').show();
}
John Strickler
+1  A: 

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!

Adam
Its solved my problem thanks !!! You're BEST!!!
SASHI