Work requirement-checkbox interaction with multiple form selection boxes

Source: Internet
Author: User

For the multi-choice box, select and select the following:

 

1.html content

<! -- Begin checkbox --> <Div class = "c_n_manage_tablexx"> <input type = "checkbox" class = "c_n_manage_checkbox c_n_manage_check"/> all selected (<SPAN class = "a_n_manage_num"> 0 </span>) <input type = "button" Disabled = "disabled" class = "c_n_manage_downbox c_n_manage_dis" id = "c_n_manage_downmodel" value = "batch dismounting"/> <input type = "button" Disabled = ""disabled" class = "c_n_manage_addgroup c_n_manage_dis" value = "add to group"/> </Div > <! -- End checkbox --> <Div class = "c_n_manage_tablecon"> <Table> <tr _ id = "1"> <TD> <input type = "checkbox" class = "c_n_manage_checkbox" /> </TD> </tr> </table> </div>

 

2. JQ code Interaction

// Select multiple boxes to set $ Doc. on ('click ','. c_n_manage_check ', function () {// select all var checkeds = $ (". c_n_manage_tablecon "). find (": checkbox"); if ($ (this ). ATTR ("checked") {checkeds. ATTR ("checked", true); $ (". c_n_manage_dis "). removeattr ("disabled"); $ (". c_n_manage_dis ").css (" cursor "," Pointer ");} else {checkeds. ATTR ("checked", false); $ (". c_n_manage_dis "). ATTR ("disabled", true); $ (". c_n_manage_dis ").css (" cursor ","");}}). on ('click ','. c_n_manage_tablecon input ', function () {// button status if ($ (this ). ATTR ("checked") {$ (". c_n_manage_dis "). removeattr ("disabled"); $ (". c_n_manage_dis ").css (" cursor "," Pointer ");} else {$ (". c_n_manage_dis "). ATTR ("disabled", true); $ (". c_n_manage_dis ").css (" cursor ","");}}). on ('click', ': checkbox', function () {// select several States $ (". a_n_manage_num ").html ($ (". c_n_manage_tablecon "). find (": checkbox: checked "). length );});

 

3. Display

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.