Javascript examples for DOM HTML Element:Input Button
Moving the submit button outside the form
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/* ww w. j a v a2 s . c o m*/ function submitform() { document.myform.submit(); } } </script> </head> <body> <form name="myform" action="handle-data.php"> Search: <input type="text" name="query"> <button onclick="submitForm();">">Search</button> </form> </body> </html>