Is it possible to change document.activeElement in JavaScript?

后端 未结 2 920
醉话见心
醉话见心 2020-12-23 15:49

Is it possible to programmatically change the value of the document.activeElement property in JavaScript?

2条回答
  •  -上瘾入骨i
    2020-12-23 16:28

    You can just .focus() the element you want and it'll be the new document.activeElement.

提交回复
热议问题