Menu
Is there a way to retrieve a value from first TD tag?
Here is an example:
<html>
<script language=”JavaScript”>
function go() {
var m = document.getElementsByTagName(“TD”);
alert(m.length);
}
</script>
<body>
<table onMouseOver=”go();”>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
</body>
</html>
Alert displays 3. I am not able to retrieve value from first element.
I tried document.getElementsByTagName(“TD”).item(0).value;
Or a different approach? Thanks.