Javascript examples for DOM HTML Element:Input Text
Setting a form input value with Javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w ww . ja va 2s . c om x = document.getElementsByTagName('form'); console.log('going '+x[0].direction.value); } </script> </head> <body> <form action="server.pl" method="POST"> <input type="hidden" name="direction" value="forward"> </form> </body> </html>