why doesnt this code work?
i am trying to add a row to the table...
<html>
<script>
function AddRow()
{
var oldvar=document.getElementById('tbl').innerHTML
newvar=oldvar+"<tr><td>Hi</td></tr>";
document.getElementById('tbl').innerHTML=newvar
}
</script>
<body>
<table id="tbl">
<tr>
<td>
Hi
</td>
</tr>
</table>
<input type="button" name="Add" value="Add" onclick="AddRow()">
</body>
</html>
Known is handfull, Unknown is worldfull
i am trying to add a row to the table...
<html>
<script>
function AddRow()
{
var oldvar=document.getElementById('tbl').innerHTML
newvar=oldvar+"<tr><td>Hi</td></tr>";
document.getElementById('tbl').innerHTML=newvar
}
</script>
<body>
<table id="tbl">
<tr>
<td>
Hi
</td>
</tr>
</table>
<input type="button" name="Add" value="Add" onclick="AddRow()">
</body>
</html>
Known is handfull, Unknown is worldfull