我正在尝试使用 JQuery 替换一整行,但似乎不起作用(该行没有被替换)。这是示例代码的链接:http: //jsfiddle.net/s2kwb/
JavaScript:
$("td.99999").first().parent().next().replaceWith("<tr><td >category 3</td>
<td >2222</td>
<td >something 22</td>
<td >something 22</td>
<td >$3,433</td>
<td >$300</td>
<td >$3,733</td>
<td >$349</td>
<td >$4,082</td>
</tr>");
html:
<table border="1">
<tr >
<th>category</th>
<th>rank</th>
<th>priority</th>
<th>contact</th>
<th>price</th>
<th>tax</th>
<th>total price</th>
<th>shipping</th>
<th>Net payment</th>
</tr>
<tr class="displaytagOddRow">
<td class="99999">category 1</td>
<td class="99999">99999</td>
<td class="99999">something</td>
<td class="99999">something</td>
<td class="99999 alignRight">$3,433</td>
<td class="99999 alignRight">$300</td>
<td class="99999 alignRight">$3,733</td>
<td class="99999 alignRight">$349</td>
<td class="99999 alignRight">$4,082</td>
</tr>
<tr class="displaytagOddRow" style="Background-color:Red">
<td class="3333">category 2</td>
<td class="3333">3333</td>
<td class="3333">something</td>
<td class="3333">something</td>
<td class="3333 alignRight">$3,433</td>
<td class="3333 alignRight">$300</td>
<td class="3333 alignRight">$3,733</td>
<td class="3333 alignRight">$349</td>
<td class="3333 alignRight">$4,082</td>
</tr>
</table>
我究竟做错了什么?
提前致谢。