Jquery将yes / no复选框设置为undefined [英] Jquery to set the yes/no checkbox to undefined

查看:90
本文介绍了Jquery将yes / no复选框设置为undefined的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

显然,当"是/否"复选框关闭时,它的值为"未定义"。 当它打开(选中)时,其值为"true"。 

Apparently, when the yes/no checkbox is off, the value of it is "undefined".  When it's on (checked), its value is "true". 

我在取消选中是/否复选框时遇到问题。  

I'm having problems unchecking the yes/no checkbox.  

我尝试了很多东西,包括下面的最后两个不起作用:

I've tried many things including the last two below that don't work:


  • $(" input [#id =' Debit_x0020_Card']")。attr('checked',false);
  • $(":input [title ='Debit Card']")。attr('checked',false);

想法?  

Ideas?  

谢谢! Patti N。

Thanks! Patti N.

推荐答案

我认为这有效:

I think this works:


(" input [title
("input[title


='借记卡']:选中")。prop('checked',false);

='Debit Card']:checked").prop('checked',false);


这篇关于Jquery将yes / no复选框设置为undefined的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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