Hi,
The following is code create a textarea dynamically(when u click the add button). what here i did is just duplicate the textarea and change its id.
<script>
var serial_number = 0;
function addTextArea()
{
container = document.getElementById("container");
div_ele = document.getElementById("test");
text_area = document.getElementById("sample");
div_ele.id = div_ele.id + "-" + serial_number;
text_area.id = text_area.id + "-" + serial_number;
div_ele.style.display = "";
container.appendChild(div_ele.cloneNode(true));
div_ele.id = "test";
text_area.id = "sample";
div_ele.style.display = "none";
serial_number++;
}
</script>
<div id = "container"> </div>
<div id = "test" style="display:none"> <textarea id = "sample"> </textarea> </div>
<input type = "button" value = "add" onClick = "addTextArea()">
Hope this meets your requirement.
~vishnu~