JS Implementation checkbox check box select all optional function

Source: Internet
Author: User

In the site of the management of the application of the majority of the background, such as a one-time processing of multiple products, or the deletion of the article to the product of the next frame, and so on, a point is obviously a bit of trouble, if you can put a checkbox for each row, and then unified treatment to do more Today I will use a simple space to explain the implementation of this function principle and implementation process.

The checkbox control is what we normally call a check box, which is typically used for opening or closing an option. This control is available in the Settings dialog box for most applications. What we see can be ticked is the checkbox.

The control indicates whether a particular state (that is, an option) is selected (on, the value is 1) or cleared (off, with a value of 0). Use this control in your application to provide users with a choice of "true/false" or "yes/no". Because the checkbox works independently of each other, the user can select as many checkbox as possible to combine options.

CheckBox checkbox JS Implementation of the full selection of all the functions, very simple, just insert a small section of the JS function on the line ...

?

1 2 3 4 5 6 7 8 9 10 11 12 13-14 <script language= "JavaScript" > Function cli (Obj) {var collid = document.getelementbyidx_x ("All") var coll = documen T.getelementsbyname (OBJ) if (collid.checked) {for (var i = 0; i < coll.length; i++) coll[i].checked = true;} else{for (var i = 0; i < coll.length; i++) coll[i].checked = false;} </script>

The following is a set of checkbox HTML code for checkboxes

?

1 2 3 4 5 6 7 <input name= ' multiple option name ' type= ' checkbox ' value= ' id= ' All ' onclick= ' CLI (' multi-option name '); " > select <input name= ' multi-option name ' type= ' checkbox ' value= ' > A <input ' multi-option name ' name= ' checkbox ' type= ' > B < Input name= ' multiple option name ' type= ' checkbox ' value= ' > C <input name= ' multi-option name ' type= ' checkbox ' value= ' > D <input name= ' Multi-option name ' type= ' checkbox ' value= ' > E <input name= ' multi-option name ' type= ' checkbox ' value= ' > F

OK, you can copy the above code, modify the test ...

The above mentioned is the entire content of this article, I hope you can enjoy.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.