Changing the innerHTML of elements in a nested div tag..
- by PoorCoder
-- Representative code only - I need to know how to change the innerhtml of the tablerow --
<html>
<head>
<script> //full javascript declaration - function call after page loads..
function ()
{
document.getElementById('tr1').innerHTML='<td>Test</td>'; // does not work..
document.getElementByTagNames('tr')[0].innerHTML='<td>Test</td>'; // does not work..
document.getElementById('div2').getElementsByTagNames('tr')[0].innerHTML='<td>Test</td>'; //does not work..
document.getElementById('div1').div2.tr1.innerHTML='<td>Test</td>'; //nope
}
</script>
</head>
<body>
<div id='div1'>
<div id='div2'>
<table>
<tr id='tr1'></tr>
</table>
</div>
</div>
</body>
</html>
Thanks for the help