如何通过点击来取消选中单选按钮? [英] How to make a radio button unchecked by clicking it?
本文介绍了如何通过点击来取消选中单选按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
选中$ c>。 $ c $ to code> false
像这样:$ b $ pre $
document.getElementById(' desiredInput')。checked = false;
PS:按住 Ctrl 键取消选中。
Unlike check boxes, it is impossible for the user to deselect radio buttons once they are clicked. Is there any way so that they can be toggled programmatically using Javascript? This would be preferably without using jQuery.
解决方案
You can set HTML object's property checked
to false
like this:
document.getElementById('desiredInput').checked = false;
PS: Hold down Ctrl key to uncheck.
这篇关于如何通过点击来取消选中单选按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文