adding line-through style to a table row

Giganews Newsgroups
Subject: adding line-through style to a table row
Posted by:  Andrus (nospam_eetasoft_no@online.ee)
Date: Sun, 20 Jul 2003

I want that if user clicks in a checkbox, the strike-through effect applices
to current table row. I tried the following code in IE, but nothing happens.

Any idea ?

<table>
<tr><td><input type=checkbox onclick="cbonclick(this)"></td>
<td><input type=text value="Row 1" ></td>
<td><select><option>pine</option><option>orange</option></select></td></tr>

<tr><td><input type=checkbox onclick="cbonclick(this)"></td>
<td><input type=text value="Row 2"></td>
<td><select><option>apple</option><option>kiwi</option></select></td></tr>
</table>

<script>
function cbonclick(othis) {
othis.parentNode.parentNode.style.textDecoration=
      othis.checked? 'line-through':'';
}
</script>

Replies