document.activeElement is an IE thing. Opera supports it partially, and this is basically what one would need to do to match IE's behaviour (after some very quick and cursory testing):
- when the document is loaded, before any interaction activeElement is the body element (!)
- activeElement is set after mousedown.
- it is set to the event's target if it is "focusable" (A, INPUT, BUTTON etc.), otherwise it is set to the event's target's .offsetParent
- it keeps pointing to the same element until another interaction with the document sets it again
It is also set when you tab through links and form fields. In Opera, spatial navigation and other keyboard navigation should of course set it too.
Haven't checked if the WHATWG or WebAPI are already embracing and/or extending it..