firefox下你死心吧,下边是官网看到的...模模糊糊的还是看到了 tag
---------------------------------------------------------------------
Gecko DOM Reference Summary The click method simulates a click on an element. Syntax element.click() Notes The click method is intended to be used with INPUT elements of type button, checkbox, radio, reset or submit. Gecko does not implement the click method on other elements that might be expected to respond to mouse–clicks such as links (A elements), nor will it necessarily fire the click event of other elements. Non–Gecko DOMs may behave differently. When a click is used with elements that support it (e.g. one of the INPUT types listed above), it also fires the element's click event which will bubble up to elements higher up the document tree (or event chain) and fire their click events too. However, bubbling of a click event will not cause an A element to initiate navigation as if a real mouse-click had been received. Specification click
---------------------------------------------------------------------------
<input id="abc" type="button" onclick="alert('wc')" />
<script type="text/javascript">
var $ = function (id) {
return document.getElementById(id);
};
a = $("abc");
if (!document.createEvent) {
a.click();
} else {
var o = a.ownerDocument.createEvent("MouseEvents");
o.initEvent("click", false, true);
a.dispatchEvent(o);
}
</script>