Which browsers support document.activeElement?

philfreo picture philfreo · Mar 15, 2011 · Viewed 13.5k times · Source

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?

Answer

Andrei picture Andrei · Mar 16, 2011

document.activeElement is supported by IE6+, FF3+, Safari 4+, Opera 9+, Chrome 9+. (FF2, Saf3 don't support this property)