Read more

How to find out the currently focused DOM element with JavaScript

Arne Hartherz
December 03, 2012Software engineer at makandra GmbH

This works in all relevant browsers:

document.activeElement
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

You can use this in your Selenium steps, for example, to assert that a form field is or is not focused.

Posted by Arne Hartherz to makandra dev (2012-12-03 13:38)