We can create an <input> element with type="submit" via the document.createElement()
method:
var x = document.createElement("INPUT"); x.setAttribute("type", "submit");
Click the button to create a Submit Button.
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <script> function myFunction() {//from w w w . j a v a2 s .co m var x = document.createElement("INPUT"); x.setAttribute("type", "submit"); document.body.appendChild(x); } </script> </body> </html>