S
student4lifer
I got the javascript show() to work on <td> but not on <tr>, once
I moved the <div> outside the <tr>, it stop working. What am I
missing? How would one fix this? Below is what I got. Thanks in
advance.
===========
<head>
<script type="text/javascript">
<!--
function show(id, checkbox) {
var visible = (checkbox.checked) ? "block" : "none";
document.getElementById(id).style.display = visible;
}
//-->
</script>
</head>
<table>
<tr>
<td></td>
<td>
<input name="car" value="T" type="checkbox"
onclick="show('div1', this)"> Car
</td>
</tr>
<div id="div1">
<tr>
<td>Make:
</td>
<td><input id="make" size="20"></td>
</tr>
<tr>
<td>Model:
</td>
<td><input id="model" size="20"></td>
</tr>
</div>
</table>
I moved the <div> outside the <tr>, it stop working. What am I
missing? How would one fix this? Below is what I got. Thanks in
advance.
===========
<head>
<script type="text/javascript">
<!--
function show(id, checkbox) {
var visible = (checkbox.checked) ? "block" : "none";
document.getElementById(id).style.display = visible;
}
//-->
</script>
</head>
<table>
<tr>
<td></td>
<td>
<input name="car" value="T" type="checkbox"
onclick="show('div1', this)"> Car
</td>
</tr>
<div id="div1">
<tr>
<td>Make:
</td>
<td><input id="make" size="20"></td>
</tr>
<tr>
<td>Model:
</td>
<td><input id="model" size="20"></td>
</tr>
</div>
</table>