문제

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?

도움이 되었습니까?

해결책

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

document.activeElement.id
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top