GitHub 6248★

Check if an element is focused

JavaScript version

const hasFocus = (ele) => ele === document.activeElement;

TypeScript version

const hasFocus = (ele: Node): boolean => ele === document.activeElement;
Follow me on and to get more useful contents.