在MSDN中fireEvent的描述很简单,就是触发一个指定的事件对象。google了下发现fireEvent也可以触发鼠标单击事件,如下:
<HTML>
<HEAD>
<SCRIPT>
function fnFireEvents()
{
div.innerText = "The cursor has moved over me!";
btn.fireEvent("onclick");
}
</SCRIPT>
</HEAD>
<BODY>
<h1>Using the fireEvent method</h1>
By moving the cursor over the DIV below, the button is clicked.
<DIV ID="div" onmouseover="fnFireEvents();">
Mouse over this!
</DIV>
<BUTTON ID="btn" ONCLICK="this.innerText='I have been clicked!'">Button</BUTTON>
</BODY>