Which browsers support document.activeElement?

13,679

Solution 1

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

Solution 2

It still doesn't work on WebKit based browsers in xhtml page see https://bugs.webkit.org/show_bug.cgi?id=63922

Share:
13,679

Related videos on Youtube

philfreo
Author by

philfreo

PhilFreo.com

Updated on January 24, 2020

Comments

  • philfreo
    philfreo over 4 years

    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?

  • ripper234
    ripper234 over 12 years
    Where do you find out such things, except on Stack Overflow? I didn't find this on quirksmode or MDN.
  • etlovett
    etlovett about 12 years
    You can find it here: developer.mozilla.org/en/DOM/…
  • Victor
    Victor almost 12 years
    Opera 9.6+ (not 9+), Chrome 2+ (the same WebKit version 530 as in Safari 4)
  • nothingisnecessary
    nothingisnecessary about 11 years
    Found this helpful site: caniuse.com but unfortunately does not have an entry for activeElement.