Javascript examples for DOM HTML Element:Input Button
Create a Button in a case statement to launch a url
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> document.write('<button id="foo">Hai!</button>'); var foo = document.getElementById('foo'); foo.onclick = function () { window.open('http://java2s.com/',"_blank"); }; </script> </body>//w ww . j a v a 2s .c om </html>