T
Thierry Lam
I have the follownig codes:
<html>
<head>
<title>Simple doc</title>
</head>
<body>
<script type="text/javascript">
function greet()
{
var table = document.getElementById("greetTable");
var cell = table.rows[0].cells[1];
var output = cell.childNodes.length;
alert(output);
}
</script>
<input type="checkbox" name="greet" onClick="greet()"/>Key Greet
<table id="greetTable" border="1">
<tr>
<td>Hello</td>
<td>
<div id="first">
<input type="button" value="hello world" onClick="say()" />
</div>
<div id="second">
Text Only
</div>
</td>
</tr>
</table>
</body>
</html>
When you click on the checkbox, it will show you how many children
cell[0,1] has. On Firefox 1.5.0.10 and Opera 9.01, the popup show 5
children. On IE 6.0.2900.2180, it shows 2 children which is the
correct answer. Can anyone tell me why it's show 5 children on the
other browsers?
Isn't the cell at [0,1] supposed to have 2 children only, div first
and div second?
Thanks
Thierry
<html>
<head>
<title>Simple doc</title>
</head>
<body>
<script type="text/javascript">
function greet()
{
var table = document.getElementById("greetTable");
var cell = table.rows[0].cells[1];
var output = cell.childNodes.length;
alert(output);
}
</script>
<input type="checkbox" name="greet" onClick="greet()"/>Key Greet
<table id="greetTable" border="1">
<tr>
<td>Hello</td>
<td>
<div id="first">
<input type="button" value="hello world" onClick="say()" />
</div>
<div id="second">
Text Only
</div>
</td>
</tr>
</table>
</body>
</html>
When you click on the checkbox, it will show you how many children
cell[0,1] has. On Firefox 1.5.0.10 and Opera 9.01, the popup show 5
children. On IE 6.0.2900.2180, it shows 2 children which is the
correct answer. Can anyone tell me why it's show 5 children on the
other browsers?
Isn't the cell at [0,1] supposed to have 2 children only, div first
and div second?
Thanks
Thierry