以下は私のhtmlです
<table id="myTable" class="dropdown">
<thead> ........... </thead>
<tbody class="myTbody1">
<!-- insert here -->
<tbody class="myTbody2">
<tbody class="myTbody3">
</table>
以下のhtml文字列をtbodyの直後に挿入する必要があります。myTbody1
var html = '<tbody class="details" colspan="9">
<table>
<thead>
<tr>
<th> Col1 </th>
<th> Col2 </th>
<th> Col3 </th>
<th> Col4 </th>
<th> Col5 </th>
<th> Col6 </th>
<th> Col7 </th>
<th> Col8 </th>
<th> Col9 </th>
</tr>
</thead>
<tbody class="head">
<tr class="nestedRow">
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
<td> Data</td>
</tr>
</tbody>
</table>
</tbody>'
私は以下のようにしようとしました、そしてそれは正しい場所に挿入します、しかしそれはhtml文字列から最初の2つのタグtbodyとtableを切り取っています。
$(html).insertAfter($(this));
ここで$(this)
等しいtbody.myTbody1
どんな助けでも大歓迎です。