移除不带'的td;我没有使用jquery的id

移除不带'的td;我没有使用jquery的id,jquery,html,button,Jquery,Html,Button,我有一个包含标签和文本框的HTML表格,其中少数td有id,少数td没有id。所有其他属性都类似。没有id的td是动态生成的。表结构如下所示 <table id="myTable"> <tr> <td class = "myclass" id="sun">hello</td> <td class = "otherclass"><input type="text" class="wonder" id = "ton

我有一个包含标签和文本框的HTML表格,其中少数td有id,少数td没有id。所有其他属性都类似。没有id的td是动态生成的。表结构如下所示

<table id="myTable">
  <tr>
    <td class = "myclass" id="sun">hello</td>
    <td class = "otherclass"><input type="text" class="wonder" id = "tone" readonly = "true"><td/>
    <td class = "myclass" id = "moon">my</td>
    <td class = "otherclass"><input type="text" class="wonder" id = "ttwo" readonly = "true"><td/>
     <td class = "myclass" id = "earth">name</td>
    <td class = "otherclass"><input type="text" class="wonder" id = "tthree" readonly = "true"><td/>
     <td class = "myclass">is</td>
    <td class = "otherclass"><input type="text" class="wonder" readonly = "true"><td/>
  </tr>
  <tr>
     <td class ="myclass">mickey</td>
      <td class = "otherclass"><input type="text" class="wonder" readonly = "true"></td>
     <td class ="myclass" id = "stars">mouse</td>
     <td class = "otherclass"><input type = "text" class="wonder" id = "tfour" readonly = "true"></td>
  </tr>
</table>
但这似乎消除了所有td的障碍。我只想删除那些没有id属性的td。有人能帮忙吗


另外请注意,该表是动态的,根据生成的动态列的数量,表结构每次都会更改。

没有id为的
td
,如果要删除包含id为的输入字段的
td
,请使用
$(“#重置”)。单击(函数(){
$('#myTable').find('tr td input:not([id])).parent().remove();
});

你好
我的
名称
是
米奇
老鼠
点击

鉴于您的tds中没有一个具有
id
,为什么您会惊讶于“删除所有非id tds”正是您所要求的?您的ID设置在
标签上,而不是
s@Pranav巴兰:我修改了html的一些部分。
$('#Reset').click(function(){  
    $('#myTable').find('tr td:not([id])').remove();
});