CKTIS / HTML
The popover attribute
The global `popover` attribute creates an initially hidden panel displayed above page content. Its `auto`, `manual`, and `hint` values determine how the panel closes.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
popover | popover="" | popover="auto" | popover="manual" | popover="hint"popover is a global enumerated attribute, not a Boolean attribute. The panel starts hidden; opening it places it in the top layer. Omitting the attribute leaves an ordinary element. Bare popover or popover="" selects auto; an invalid value, including popover="false", selects manual rather than disabling the feature.
auto closes other automatic popovers, except appropriate ancestor popovers. Opening a hint popover can close other hint popovers while keeping relevant ancestors open. If it opens under an open auto ancestor, it can also close auto popovers above that ancestor in the stack. Both modes support outside-click dismissal and close requests, usually through Escape. manual neither closes other popovers nor responds to these dismissal mechanisms.
A button's popovertarget references the panel's id; its default action toggles visibility. popovertargetaction="hide" explicitly closes it. JavaScript also provides showPopover(), hidePopover(), and togglePopover(). Place the panel immediately after its trigger in the DOM when possible for logical reading order. The attribute does not replace accessibility semantics appropriate to the content.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>Popover example</title>
<button type="button" popovertarget="help">Help</button>
<div id="help" popover="auto">
Settings are saved automatically.
<button type="button" popovertarget="help" popovertargetaction="hide">Close</button>
</div>
</html>Result
Initially: Help is visible; the popover is hidden. Activate Help: Settings are saved automatically. and Close become visible. Activate Close: the popover is hidden again.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.