JavaScript Reference/Javascript Methods/fireEvent

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

"fireEvent()" Example

    
<html>
<body>
<button onmouseover="this.fireEvent("onclick")" 
        onclick="alert("Hello");">
Fire onclick event
</button>
</body>
</html>



"fireEvent()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <acronym>                     |
|                |<address>                       <applet>                      |
|                |<area>                          <b>                           |
|                |<base>                          <basefont>                    |
|                |<bdo>                           <bgsound>                     |
|                |<big>                           <blockquote>                  |
|                |<body>                          <br>                          |
|                |<button>                        <caption>                     |
|                |<center>                        <cite>                        |
|                |<code>                          <col>                         |
|                |<colgroup>                      <comment>                     |
|                |<custom>                        <dd>                          |
|                |<del>                           <dfn>                         |
|                |<dir>                           <div>                         |
|                |<dl>                            <dt>                          |
|                |<em>                            <embed>                       |
|                |<fieldset>                      <font>                        |
|                |<form>                          <frame>                       |
|                |<frameset>                      <head>                        |
|                |<hn>                            <hr>                          |
|                |<html>                          <i>                           |
|                |<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">           |
|                |<ins>                           <isindex>                     |
|                |<kbd>                           <label>                       |
|                |<legend>                        <li>                          |
|                |<link>                          <listing>                     |
|                |<map>                           <marquee>                     |
|                |<menu>                          <nobr>                        |
|                |<noframes>                      <noscript>                    |
|                |<object>                        <ol>                          |
|                |<option>                        <p>                           |
|                |<plaintext>                     <pre>                         |
|                |<q>                             <rt>                          |
|                |<ruby>                          <s>                           |
|                |<samp>                          <script>                      |
|                |<select>                        <small>                       |
|                |<span>                          <strike>                      |
|                |<strong>                        styleSheet                    |
|                |<sub>                           <sup>                         |
|                |<table>                         <tbody>                       |
|                |<td>                            <textarea>                    |
|                |<tfoot>                         <th>                          |
|                |<thead>                         <title>                       |
|                |<tr>                            <tt>                          |
|                |<u>                             <ul>                          |
|                |<var>                           <wbr>                         |
|                |<xml>                           <xmp>                         |
+----------------+--------------------------------------------------------------+



"fireEvent()" Syntax, Parameters and Note

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.