Submit.focus() : submit button : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » submit button »

 

Submit.focus()







The focus() method places focus on the Submit button.












<html>
    <head>
    <script language="JavaScript">
    <!--
    function setFocus(){
      document.myForm.mySubmit.focus();
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">
      <input type=TEXT value="Hello, World!" name="myText" onFocus="setFocus()">
      <input type=SUBMIT value="Submit" name="mySubmit">
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» submit button