我有一些JavaScript功能,包括類似的代碼:,而不是使用的document.all
if (document.all)
{ document.getElementById('subrow').style.display = 'block'; }
else
{ document.getElementById('subrow').style.display = 'table-row'; }
IE 11的回報false
爲document.all
所以上面的代碼不再工作,但我需要它爲早期的工作IE版本以及IE 11和其他瀏覽器。
我該如何做到這一點? IE的早期版本不明白table-row
,所以我必須能夠區分。
- 興趣IE7及更高版本。和IE7不理解 '錶行' –
參考: http://stackoverflow.com/questions/2408424/document-all-vs-document-getelementbyid http://stackoverflow.com/問題/ 13663023/what-does-document-all-mean – Muthu
IE8 +確實明白'display:table-row' ... –