MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getActiveElement

Method getActiveElement

src/main/java/org/htmlunit/html/HtmlPage.java:2590–2601  ·  view source on GitHub ↗

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. @return the element with focus or the body

()

Source from the content-addressed store, hash-verified

2588 * @return the element with focus or the body
2589 */
2590 public HtmlElement getActiveElement() {
2591 final DomElement activeElement = getFocusedElement();
2592 if (activeElement instanceof HtmlElement element) {
2593 return element;
2594 }
2595
2596 final HtmlElement body = getBody();
2597 if (body != null) {
2598 return body;
2599 }
2600 return null;
2601 }
2602
2603 /**
2604 * <p><span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span></p>

Callers 2

setCurrentWindowMethod · 0.95
detachMethod · 0.45

Calls 2

getFocusedElementMethod · 0.95
getBodyMethod · 0.95

Tested by

no test coverage detected