I would like to find out, in JavaScript, which element currently has focus.
(我想用JavaScript找出当前关注的元素。)
I've been looking through the DOM and haven't found what I need, yet. (我一直在浏览DOM,但尚未找到我需要的东西。)
Is there a way to do this, and how? (有办法做到这一点吗?)
The reason I was looking for this:
(我寻找这个的原因:)
I'm trying to make keys like the arrows and enter
navigate through a table of input elements.
(我试图使像箭头键和enter
通过输入元素表中导航。)
Tab works now, but enter, and arrows do not by default it seems. (选项卡现在可以使用,但是可以输入,默认情况下,箭头没有显示。)
I've got the key handling part set up but now I need to figure out how to move the focus over in the event handling functions. (我已经设置了关键处理部分,但是现在我需要弄清楚如何在事件处理功能中转移焦点。)
ask by Tony Peterson translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…