使用javascript选中和取消选中复选框 [英] use of javascript to check and uncheck checkboxes

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

问题描述

我希望当所有子复选框都未选中时,javascript取消选中标头复选框.请提供相关解决方案.

在此先感谢

i want javascript to uncheck the header checkbox when all of the child checkboxes gets unchecked. please reply with a relevant solution.

thanks in advance

推荐答案

使用JQuery为子复选框的已更改事件添加处理程序.在该测试中,是否已全部取消选中并取消选中父项.
Use JQuery to add a handler for the changed event of the children checkboxes. In that test if all have been unchecked and uncheck the parent.


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

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