<td>
要素が多すぎるtable
が生成されました。私はそれにクラス名SlideInfo
を持っていない不要な<td>
のすべての要素を削除するjQueryがあまりにも多くのhtmlを取り除く
$('#Container td[class!="SlideInfo"]').remove();
を呼び出します。問題は、私も内部テーブル(子)が削除されていることです。どうすればjQueryに、内側のものではなく、<td>
の兄弟だけを削除するように指定することもできます。
<table>
<tr>
<td class="SlideInfo">
<table>
<td class="SlideInfo">
This gets removed, I know the html is wrong on this but this is an example.
</td>
</table>
</td>
<td class="SlideInfo">
<table>
<td class="SlideInfo">
This gets removed, I know the html is wrong on this but this is an example.
</td>
</table>
</td>
</tr>
</table>
オフ
開始は私が$('#Container td[class!="SlideInfo"]').remove();
を呼び出し、それは、これらの不要なtd
削除年代に、それはまた、子供td
削除 'は私が欲しいんものの秒。
削除したいものと削除したくないものを区別しますか? –
私は、悪いHTMLを修正するためにjQueryに依存しません。代わりにルートの問題を解決してみませんか? – Sparky
@pb彼らは私が欲しいもののクラスを持っています。 – user516883