Javascript examples for DOM HTML Element:Input Button
add a button and set its text value with createTextNode
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* w w w . j ava2 s. com*/ var btn = document.createElement("BUTTON"); var t = document.createTextNode("CLICK ME"); btn.appendChild(t); document.getElementById('test').appendChild(btn); } </script> </head> <body> <div id="test"> add button below </div> </body> </html>