JavaScript Reference/Javascript Methods/fireEvent

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"fireEvent()" Example

   <source lang="javascript">
   

<html> <body> <button onmouseover="this.fireEvent("onclick")"

       onclick="alert("Hello");">

Fire onclick event </button> </body> </html>


     </source>
   
  


"fireEvent()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |<a> <acronym> | | |<address> <applet> | | |<area> | | |<base> <basefont> | | | <bgsound> |

| |
|

| |<body>
| | |<button> |

| |
|

| | <col> | | |<colgroup> <comment> | | |<custom>

| | | |

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

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

| |<legend>
  • | | |<link> <listing> | | |<map> <marquee> | | |<menu> <nobr> | | |<noframes> <noscript> | | |<object>
      | | |<option>

      | | |<plaintext>

                               |
      |                |                                                       |
      |                |                                                     |
      |                |                          <script>                      |
      |                |<select>                                               |
      |                |                                                |
      |                |                        styleSheet                    |
      |                |                                                    |
      |                |                         <tbody>                       |
      |                |                          |
      |                |                             
        | | | | | |<xml> <xmp> | +----------------+--------------------------------------------------------------+ </source>

        "fireEvent()" Syntax, Parameters and Note

        <source lang="javascript"> Note: Fire event on the element. Returns true (successful) or false (failed).

        Syntax:

        document.styleSheets[index].fireEvent(param1, param2) document.all.elementID.fireEvent(param1, param2) Parameters: param1 Required; the name of the event. param2 Optional; an existing event object to clone.


        </source>

      <textarea> | | |<tfoot> |

      | |<thead> <title> |

      | |