JavaScript Reference/Event Handlers Reference/onFocus

Материал из Web эксперт
Перейти к: навигация, поиск

"onFocus" Example

   <source lang="javascript">
   

<head> <script language="JavaScript"> function function1() {

   document.getElementById("myL").blur();
   alert("<A> element has received focus.");
   window.open("http://www.wbex.ru", "", ""); 

} </script> </head> <body> <a id="myL"

  href="http://www.wbex.ru/" 
  target=_blank 
  onFocus="function1()">
   www.wbex.ru

</a> </body>


     </source>
   
  


"onFocus" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | | |

| |
<body> |

| |<button> |

| |
|

| |<custom>

| | | |

| |<dir>
| | |
| | | <embed> | | |<fieldset> | | |<form> <frame> | | |<frameset> <hn> | | |
|

| |<iframe> <img> | | |<input type="button"> <input type="checkbox"> | | |<input type="file"> <input type="hidden"> | | |<input type="image"> <inputtype="password"> | | |<input type="radio"> <input type="reset"> | | |<inputtype="submit"> <input type="text"> | | | <isindex> | | | <label> |

| |<legend>
  • | | |<listing> <map> | | |<marquee> <menu> | | |<object>
      | | |<optgroup> <option> | | |

                               |
      |                |                                                       |
      |                |                                                     |
      |                |                          <select>                      |
      |                |                                                 |
      |                |                                              |
      |                |                                                    |
      |                |                         <tbody>                       |
      |                |                          |
      |                |                                                       |
      |                |
        | | |window <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "onFocus" Properties

        <source lang="javascript"> +----------------+--------------------------------------------------------------+ | Properties |altKey altLeft | | |clientX clientY | | |ctrlLeft offsetX | | |offsetY returnValue | | |screenX screenY | | |shiftLeft srcElement | | |type x | | |y | +----------------+--------------------------------------------------------------+

        </source>



        "onFocus" Syntax and Note

        <source lang="javascript"> Note:

        This event fires when the element on the page receives focus.

        </source>

      <textarea> | | |<tfoot> | | |<thead>