如何使用JQUERY选中/取消选中CheckBoxList中的复选框 [英] How to check/uncheck the checkboxes in CheckBoxList using JQUERY

查看:119
本文介绍了如何使用JQUERY选中/取消选中CheckBoxList中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我的要求是两个具有相同数据的CheckBoxList.如果我检查了第一个CheckBoxList项,则自动删除了第二个CheckboxList项.以及是否取消选中第一个CheckBoxList中的项目并自动添加到第二个checkboxList中.

请任何人帮帮我..

Hi guys, My requirement is two CheckBoxList with same Data. in First CheckBoxList if i check the Item then automatically removes the Second CheckboxList Item. as well as if i uncheck the item in first CheckBoxList and automatically adding into second checkboxList.

Please any one help me..

推荐答案

您可以使用clone()和html()方法来做到这一点.

例如.

you can do it by using clone() and html() method.

eg.


(函数(){ // 在检查ist复选框列表事件时,此操作会创建一个新列表,但ist列表中的已检查数据除外. // 复制除ist列表中选中的所有数据 ( var tempSecListString = " secId " ; // 为每个数据创建一个循环
(function(){ //on check of ist checkboxlist event do this create a new list except checked data in ist list. // copy all data except checked in ist list ( var tempSecListString = "<select id="secId">"; // for each data create a loop


(" ).each(funtion(){ 如果(!
("data").each(funtion(){ if(!


这篇关于如何使用JQUERY选中/取消选中CheckBoxList中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆