Hi,
In a HTML FORM I have some elements with in SPAN Tag and button "ADD" out side the span. When a user click on the button I want to create a new set of HTML elements that are in the SPAN tag and display it after the tag ie., I need to display the HTML fields twice with in the FORM.
Using innerHTML i can get the src with in the span tag, but the question is how do I display that back as elements so that the user can enter some data.
I hope I am clear with what I am trying, Help is greatly appreciated.
Thanks
Venu
In a HTML FORM I have some elements with in SPAN Tag and button "ADD" out side the span. When a user click on the button I want to create a new set of HTML elements that are in the SPAN tag and display it after the tag ie., I need to display the HTML fields twice with in the FORM.
Using innerHTML i can get the src with in the span tag, but the question is how do I display that back as elements so that the user can enter some data.
Code:
<html>
<head>
<title>Page</title>
</head>
<script language="javascript">
function addNew(){
var oElement = document.getElementById("org");
var oInnerHTML = oElement.innerHTML;
alert(oInnerHTML);
}
</script>
<body>
<form method="POST" action>
<span id="org">
<table border="1" width="57%">
<tr>
<td width="50%"><span id="org0">Name:</span></td>
<td width="50%"><span id="org3"><input type="text" name="T1" size="20"></span></td>
</tr>
<tr>
<td width="50%"><span id="org1">Class:</span></td>
<td width="50%"><span id="org4"><select size="1" name="D1">
<option>One</option>
<option>Two</option>
<option>Three</option>
</select></span></td>
</tr>
<tr>
<td width="50%"><span id="org2">Number :</span></td>
<td width="50%"><span id="org5"><input type="text" name="T2" size="20"></span></td>
</tr>
<tr>
<td width="50%"> </td>
<td width="50%"> </td>
</tr>
</table>
</span>
<input type="button" value="Add " name="B3" onClick="addNew()">
</form>
</body>
</html>
I hope I am clear with what I am trying, Help is greatly appreciated.
Thanks
Venu