【发布时间】:2012-03-17 20:40:04
【问题描述】:
<input type="radio" name="things" value="exam" /> exam
<input type="radio" name="things" value="journey" /> journey
$("input[name=things]").click(function(){
if($(this).is(':checked')){
$(this).removeAttr('checked')
}
})
这不起作用。我怎样才能让它工作?这是我希望它运行的方式:如果我单击选定的输入,那么应该取消选中它,但是如果我单击未选择的输入,那么应该选中它并取消选中其他输入。
【问题讨论】:
-
您好,您是说如果您单击文本考试或旅程,则应选择或取消选择相应的输入?
标签: javascript jquery html