[HTML5] document.activeElement

When you doing Modal UI component, one common aria issue you need to deal with is "Refoucs the opener element when Modal closed".

 

To do this, you need to use 

document.activeElement

 

You can save in a variable, when modal get closed, call '.focus()' method on it.

posted @ 2020-06-08 19:02  Zhentiw  阅读(201)  评论(0编辑  收藏  举报