<button onclick=AddTextArea()>Add</button><br>
<div id=oTextAreas>
<hr>
</div>
<script>
function AddTextArea()
{
  oTextAreas.innerHTML += "<textarea cols=30 rows=5></textarea>\n";
}
</script>

解决方案 »

  1.   

    var newTextArea=document.createElement("<textarea></textarea>");
    document.body.insertBefore(newTextArea);
    newTextArea.style.width ="200px";
    newTextArea.style.height="100px";
      

  2.   

    <body><button onclick='document.body.insertAdjacentHTML("beforeEnd","<textarea cols=30 rows=5></textarea>\n");'>Add</button><br>
      

  3.   

    <body><button onclick='document.body.insertAdjacentElement("beforeEnd",document.createElement("TextArea"));'>Add</button><br>