HTML DOM
GitHub 0★
Detect if an element is focused
Assume that
ele
represents the element that you want to check if it has the focus currently:
const
hasFocus
=
ele
===
document
.
activeElement
;
Detect clicks outside of an element
Detect if the caps lock is on