Javascrip-Add new textbox at runtime in your DIV tag

<html>
     <head>
          <title>Dynamic Form</title>
               <script type="text/javascript" >
               function NewTextbox()
               {
                    var t = 1;
                    newTextbox.innerHTML = newTextbox.innerHTML +"<input type=text name='txt'+ t />"
               }
               </script>
     </head>
      
     <body bgcolor=#00ff00 alink=blue vlink=blue>
          <form name="form" action="post" method="">
               <input type="button" value="Add New TextBox" onClick="NewTextbox()">
               <div id="newTextbox"></div>
          </form>
     </body>
</html>


Ebook Download
View all
Learn
View all