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