Select.onFocus : Select : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Select »

 

Select.onFocus







The onFocus event handler is fired when the focus is set on that particular select box.












<html>
    <head>
    <script language="JavaScript">
    <!--
    var counter = 0;

    function sendAway(){
      document.myForm.counter.focus();
      document.myForm.counter.value = counter++;
    }
    -->
    </script>
    </head>
    <body onLoad='sendAway()'>
    <form name="myForm">
      <select name="mySelect" multiple onFocus='sendAway()'>
        <option value=A>AA</option>
        <option value=B>BB</option>
        <option value=C>CC</option>
        <option value=D>DD</option>
      </select>
      <input type=TEXT size=value="" name="counter">
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Select