Domanda

I want to check whether the current focus is in editor or not at the compose screen in Thunderbird.

I tried below code but it is giving me null instead of object of that focused element.

XUL

<editor type="content-primary" id="content-frame" src="about:blank"
        name="browser.message.body" flex="1" context="msgComposeContext"/>    

JS

alert(document.commandDispatcher.focusedElement);

I want to check whether the current focus is on editor (body area) or not. How can I get the currently focused element?

È stato utile?

Soluzione

Okay. I got the answer. You can check using below code.

document.activeElement.id
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top