Javascrip-Add new textbox at runtime in your DIV tag

  1. <html>  
  2.    <head>  
  3.       <title>Dynamic Form</title>  
  4.       <script type="text/javascript" >  
  5.          function NewTextbox()           
  6.          {  
  7.               var t = 1;  
  8.               newTextbox.innerHTML = newTextbox.innerHTML +"<input type=text name='txt'+ t />"           
  9.          }           
  10.       </script>  
  11.    </head>  
  12.    <body bgcolor=#00ff00 alink=blue vlink=blue>  
  13.       <form name="form" action="post" method="">  
  14.          <input type="button" value="Add New TextBox" onClick="NewTextbox()">  
  15.          <div id="newTextbox"></div>  
  16.       </form>  
  17.    </body>  
  18. </html> 

Next Recommended Reading Hide and Show DIV using JavaScript