2011-07-26 54 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'); 
      }); 
相關問題