javascript 觸發(fā)HTML元素綁定的函數(shù)
更新時間:2010年09月11日 02:28:52 作者:
只能觸發(fā)函數(shù)的執(zhí)行,并不能完全模擬出實際的點擊。
復(fù)制代碼 代碼如下:
if (document.createEvent) {
var clickEvent = document.createEvent("MouseEvents");
clickEvent.initEvent("click", false, true);
this.fileEl.dom.dispatchEvent(clickEvent);//ff
} else if (document.createEventObject) {
this.fileEl.dom.fireEvent("onclick", document.createEventObject(e.browserEvent));//ie
}
相關(guān)文章
getElementByID、createElement、appendChild幾個DHTML元素
WEB標(biāo)準(zhǔn)下可以通過getElementById(), getElementsByName(), and getElementsByTagName()訪問2008-06-06js RuntimeObject() 獲取ie里面自定義函數(shù)或者屬性的集合
取得ie 里面 自定義函數(shù)或者屬性的集合 使用RuntimeObject()實現(xiàn),需要的朋友可以參考下。2010-11-11ES6標(biāo)準(zhǔn) Arrow Function(箭頭函數(shù)=>)
ES6標(biāo)準(zhǔn)新增了一種新的函數(shù):Arrow Function(箭頭函數(shù)),為什么叫Arrow Function?因為它的定義用的就是一個箭頭2020-05-05