+
95
-

js如何检测dom元素是否被聚焦?

请问js如何检测dom元素是否被聚焦?

网友回复

+
15
-

可以使用Document对象的只读属性activeElement,代码如下:

const ...

点击查看剩余70%

我知道答案,我要回答