2011-07-26 51 views
2

这是我的代码,我想要在单击按钮时隐藏收音机的响应。删除表格中单选按钮的选中属性

<table class='x'> 
<tr><td><input type="radio"></td></tr> 
<tr><td><input type="text"></td></tr> 
</table> 
<input type='button' id="a" value="dfrfvrgv"> 

这里是jQuery代码

$('#a').click(function() 
      { 
       $('TABLE .x').find('input').removeAttr('checked'); 
      }); 

但它不工作,似乎是代码问题。请有人帮助我。

回答

7
$('#a').click(function() 
      { 
       $('TABLE.x').find('input').removeAttr('checked'); 
      }); 

在选择

没有足够的空间,你在找什么,在那里的空间,是具有类X台的子节点。 table.x查找一个x类的表。

2

$('table.x')是一个正确的选择

1

选择器中有一个空格。试试下面的代码:

$('#a').click(function() 
      { 
       $('TABLE.x').find('input').removeAttr('checked'); 
      }); 
相关问题