Reset.focus() : Reset : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Reset »

 

Reset.focus()







The focus() method sets the focus to the Reset button.












<html>
    <head>
    <title> Example of the reset focus method</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function focusReset(){
         document.form1.resetbutton.focus();
    }
    -->
    </script>
    <form name="form1">
    Enter Name: <input type="text" Name="name" Size=15>
    <br>
    Enter Phone: <input type="text" Name="phone" Size=10>
    <br><br>
    <input type="reset" name=resetbutton value=Reset>
    <br>
    <br>
    <input type="button" value="Set Focus to Reset" onClick='focusReset()'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Reset