Javascript examples for DOM HTML Element:Form Event
Create input HTML element and append to a form
<html> <head> <title> Text </title> </head> <body id="tbody"> <script> function add(){// w w w .j av a 2 s.c o m el = document.getElementById("testform"); var nf=document.createElement("input"); nf.type="text"; el.appendChild(nf); } </script> <p> </p> <form id="testform"> <label onclick="add();"> create</label> </form> <p></p> </body> </html>