jquery full selection, all-in-all, anti-select operation

Source: Internet
Author: User

1<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >234<title> New Page </title>5<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>6<meta name= "description" content= ""/>7<meta name= "keywords" content= ""/>8<script type= "Text/javascript" src= ". /jquery-1.4.4.js "></script>9 Ten<script type= "Text/javascript" > One         functionSelall () { A$ (". Ho"). attr (' checked ',true); -         } -         functionSelallnot () { the$ (". Ho"). attr (' checked ',false); -         } -         functionSelfan () { -             //Reverse Selection Operation +             //Get all check boxes, traverse, and determine the current selection -              for(vari=0; i<$ (". Ho"). Length; i++){ +                 varFlag = $ (". Ho:eq (" +i+ ")"). attr ("Checked"); A$ (". Ho:eq (" +i+ ")"). attr ("Checked",!flag); at             } -         } -</script> - -<body> - in  -<input type= "checkbox" Name= "hobby[]" id= "Hobbya" class= "ho" value= ' a ' >Basketball to<input type= "checkbox" Name= "hobby[]" id= "hobbyb" class= "ho" value= ' B ' >Football +<input type= "checkbox" Name= "hobby[]" id= "HOBBYC" class= "ho" value= ' C ' >Mountaineering -<input type= "checkbox" Name= "hobby[]" id= "hobbyd" class= "ho" value= ' d ' >Volleyball the  *<br/><br/> $<input type= "button" value= "Select All" onclick= "Selall ()"/>Panax Notoginseng<input type= "button" value= "All do not select" onclick= "Selallnot ()"/> -<input type= "button" value= "Reverse Selection" onclick= "Selfan ()"/> the</body> +</body> A

jquery full selection, all-in-all, anti-select operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.