Javascript examples for DOM HTML Element:Input Button
Hide form after clicking submit button
<html lang="en"> <head></head> <body> <form name="myFirstForm" method="GET" action="?"> <input type="text" name="bob"> <input type="submit"> </form> <script> document.forms['myFirstForm'].addEventListener('submit', function (event) { // Do something with the form's data here this.style['display'] = 'none'; event.preventDefault();/*w w w. j av a2s.c o m*/ }); </script> </body> </html>