1、firefox不支持innerText,outerText,outerHTML
解決思路:a)用innerHTML替換innerText
b)爲Firefox擴展innerText屬性,詳細參考:Firefox 不支持 DOM 對象的 outerHTML、innerText、outerText 屬性(http://www.w3help.org/zh-cn/causes/SD9017)
2、firefox不支持onfocusin,onfocusout
參考:http://help.dottoro.com/ljggspvo.php
http://stackoverflow.com/questions/13516931/prevent-cursor-moving-on-text-input
Instead of EDIT
I just realized, that there is no The script:
and for
Now this supposed to be a cross-browser solution. |
|
|
在對radio input進行操作時,會用到document.all來選擇某個值,比如:
document.all["carType"][0].checked = true;
但是在firefox裏不支持document.all,就可以用getElementsByName等來代替:
if (document.all) {
document.all["carType"][0].checked = true;
} else
document.getElementsByName("carType")[0].checked = true;