Focus management in HTML In the HTML5 working draft, the activeElement DOM attribute and the hasFocus() DOM method give the programmer the ability to have better control of the interactivity of the page due to the user's actions. For example, both of them can be used for statistical usage purposes, tracking the number of clicks on certain links of a page, measuring the amount of time an element is focused, and so forth.