javascript - How do I find out which DOM element has the focus? -


I would like to explore in javascript, which is currently focused. I am seeing through Dome and I have not got what I need, even then. One way to do this, and how?

The reason I was watching was:

I am trying to make keys like arrows and navigate through a table of enter input elements The tab now works, but enter and the arrow does not seem to be the default. I have an important handling part installed, but now I have to figure out how to focus in event handling functions. Use document.activeElement , it is supported in all major browsers.

First, if you were trying to figure out which type of field is the focus, you can not. To emulate the identity within the old browsers, add a "focus" event handler to all the fields and record the last-centered field in the variable.

  • < / Li>
  • li>

  • Comments