我有一张桌子,每行旁边都有一个死按钮,供人们在发现链接失效时按下。当按下“死”按钮时,我希望该行有一条线穿过它。
未按下按钮:
<td>cupcake</td>
<td>cupcake</td>
<td>cupcake</td>
<td>cupcake</td>
<td>cupcake</td>
<td>cupcake</td>
<td><button class="btn btn-danger btn-mini" type="button" id="dead">Dead</button></td>
按下按钮时,会发生这种情况:
<td style="text-decoration:line-through">cupcake</td>
<td style="text-decoration:line-through">cupcake</td>
<td style="text-decoration:line-through">cupcake</td>
<td style="text-decoration:line-through">cupcake</td>
<td style="text-decoration:line-through">cupcake</td>
<td><button class="btn btn-danger btn-mini" type="button" id="dead">Dead</button></td>
我试过了,但没有用:
$("#dead").click(function() {
<td style="text-decoration:line-through"></td>
<td style="text-decoration:line-through"></td>
<td style="text-decoration:line-through"></td>
<td style="text-decoration:line-through"></td>
<td style="text-decoration:line-through"></td>;
});