<html> <body> <form id="myForm" method="get" name="myForm"> Name: <input type="text" size="20" value="Bill Gates" /> </form> <script type="text/javascript"> document.write("Form name: "); document.write(document.getElementById('myForm').name); </script> </body> </html>