Button.blur() : Button : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Button »

 

Button.blur()









Syntax








document.form.button.blur()



The blur() method removes the focus from a button.












<html>
    <head>
        <script language="JavaScript">
    <!--
    function removeFocus()
    {
      document.myForm.button2.blur();
    }

    -->
    </script>
    </head>
    <form name="myForm">
      <input type="button"
             value="I hold my focus after a click"
             name="button1"><br>
      <input type="button"
             value="I can not hold my focus after a click"
             name="button2"
             onClick="removeFocus()">
    </form>

    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Button