http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/fireevent.asp
Fires a specified event on the object.
Syntax
bFired
=
object.fireEvent(sEvent [,oEventObject])
Parameters
sEvent | Required. String that specifies the name of the event to fire. |
oEventObject | Optional. Object that specifies the event object from which to obtain event object properties. |
Return Value
Boolean. Returns one of the following values:
true | Event fired successfully. |
false | Event was cancelled. |
Remarks
If the event being fired cannot be cancelled, fireEvent always returns true.
Regardless of their values specified in the event object, the values of the four event properties—cancelBubble, returnValue, srcElement, and type—are automatically initialized to the values shown in the following table.
Event object property | Value |
---|
cancelBubble | false |
returnValue | true |
srcElement | element on which the event is fired |
type | name of the event that is fired |
Example
<html>
<head>
<script>
function fnfireevents()
{
odiv.innertext = " the cursor has moved over me! ";
obutton.fireevent(" onclick ");
}
</script>
</head>
<body>
<h1> using the fireevent method </h1>
by moving the cursor over the div below, the button is clicked.
<p>
<div id="odiv" onmouseover="fnfireevents();">
mouse over this!
</div>
<p>
<button id="obutton" onclick="this.innertext='i have been clicked!'">
button </button>
</body>
</html>