问题
Which web browsers / versions have support for document.activeElement
?
This property lets you see which element is active / has focus.
Are there any main gotchas/difference between implementations?
回答1:
document.activeElement is supported by IE6+, FF3+, Safari 4+, Opera 9+, Chrome 9+. (FF2, Saf3 don't support this property)
回答2:
It still doesn't work on WebKit based browsers in xhtml page see https://bugs.webkit.org/show_bug.cgi?id=63922
来源:https://stackoverflow.com/questions/5318415/which-browsers-support-document-activeelement