DevTools Tips

Detect the element with focus at any time

Categories: Supported by:

If you want to know which element has the focus on the web page at any time, you can use a live expression in the Console tool.

  1. Open the Console.
  2. Click the Create live expression button (it looks like an eye icon).
  3. In the text box that appears, type document.activeElement.
  4. Now click/tab around on the page and see the live expression update to reflect which element is currently focused.

GIF animation showing a web page with focus going through different element, and the Edge Console panel with the live expression showing a preview of the focused element