P
Peter Kirk
Hi there
can someone please help me with creating dynamic content in a table? For
example, see the below javascript and html - why is a new row not created in
the table when I click the button? (I am using Internet Explorer 6).
<html>
<head>
<title>TEST</title>
<script language="javascript">
function addField() {
alert( 'Add Field' );
my_div.innerHTML = my_div.innerHTML + "<tr><td>new row</td></tr>";
}
</script>
</head>
<body>
<table border="1">
<tr>
<td>
first row
</td>
</tr>
<div id="my_div"></div>
<tr>
<td>
<input type="button" value="click me"
onclick="javascript:addField()" >
</td>
</tr>
</table>
</body>
</html>
Thanks,
Peter
can someone please help me with creating dynamic content in a table? For
example, see the below javascript and html - why is a new row not created in
the table when I click the button? (I am using Internet Explorer 6).
<html>
<head>
<title>TEST</title>
<script language="javascript">
function addField() {
alert( 'Add Field' );
my_div.innerHTML = my_div.innerHTML + "<tr><td>new row</td></tr>";
}
</script>
</head>
<body>
<table border="1">
<tr>
<td>
first row
</td>
</tr>
<div id="my_div"></div>
<tr>
<td>
<input type="button" value="click me"
onclick="javascript:addField()" >
</td>
</tr>
</table>
</body>
</html>
Thanks,
Peter