欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

各瀏覽器對(duì)click方法的支持差異小結(jié)

 更新時(shí)間:2011年07月31日 21:57:58   投稿:mdxy-dxy  
click方法可以用來模擬用戶點(diǎn)擊。有的瀏覽器中所有元素都具有click方法,有的瀏覽器則沒有。

如下

IE6/7/8/9/Opera12/Firefox5 Safari5/Chrome12
INPUT[type=text]
INPUT[type=password]
INPUT[type=radio]
INPUT[type=checkbox]
INPUT[type=button]
INPUT[type=submit]
INPUT[type=image]
INPUT[type=hidden]
INPUT[type=reset]
INPUT[type=submit]
INPUT[type=file]1
BUTTON[type=button]
支持 支持
other 支持 不支持

即Safari/Chrome沒有完全支持click方法。click方法寫進(jìn)了HTML5草案,相信不久的將來Safari/Chrome也會(huì)支持。

需要注意的Firefox5之前的版本并不是所有元素都支持click方法,從w3help當(dāng)時(shí)測(cè)試結(jié)果即可看出。

Mozilla官方也有以下一段話

Prior to Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), Gecko didn't 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. However, now it is supported by all elements, as required by HTML5.  

雖然Firefox5現(xiàn)在對(duì)所有元素都添加了click方法,仍需注意它的click方法觸發(fā)不了A的默認(rèn)行為。IE/Opera卻可以。

相關(guān)文章

最新評(píng)論