Why doesn't this piece of code work? When I used the commented part instead of the table it works... Use table why cannot work?
<html>
<head>
<script type="text/javascript">
function addLine() {
var p = document.createElement('p');
p.innerHTML = "hello";
document.getElementById("addline").appendChild(p);
}
</script>
</head>
<body>
<!--
<input type="submit" value="New Line" onClick="addLine()"/>
<div id="addline"></div>
-->
<table>
<tbody>
<tr>inside a table</tr>
</tbody>
<tfoot>
<tr><input type="submit" value="New Task" onClick="addLine()"/></tr>
<tr id="addline"></tr>
</tfoot>
</table>
</body>
</html>