[Web-development (jquery)] Simple jquery Select All Checkbox

Simple jquery Select All Checkbox
Simple jquery Select All Checkbox



<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <SCRIPT language="javascript"> $(function(){ // add multiple select / deselect functionality $("#selectall").click(function () { $('.item').attr('checked', this.checked); }); // if all checkbox are selected, check the selectall checkbox and viceversa $(".item").click(function(){ if($(".item").length == $(".item:checked").length) { $("#selectall").attr("checked", "checked"); } else { $("#selectall").removeAttr("checked"); } }); }); </SCRIPT> Select All Checkbox <input type="checkbox"/><br/> <input type="checkbox" value="1"/> Jquery<br/> <input type="checkbox" value="2"/> php mysql<br/> <input type="checkbox" value="3"/> Java<br/> 

0 Response to "[Web-development (jquery)] Simple jquery Select All Checkbox "

Post a Comment

Contact

Name

Email *

Message *