HTMLElement: popover property

Baseline 2025 *
Newly available

Since January 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

* Some parts of this feature may have varying levels of support.

The popover property of the HTMLElement interface gets and sets an element's popover state via JavaScript ("auto", "hint", or "manual"), and can be used for feature detection.

It reflects the value of the popover global HTML attribute.

Value

An enumerated value; possible values are:

"auto"

auto popovers can be "light dismissed" — this means that you can hide the popover by clicking outside it or pressing the Esc key.

Usually, only one auto popover can be shown at a time — showing a second popover when one is already shown will hide the first one. The exception to this rule is when you have nested auto popovers. See Nested popovers for more details.

"hint"

hint popovers do not close auto popovers when they are displayed, but will close other hint popovers. They can be light dismissed and will respond to close requests.

Usually they are shown and hidden in response to non-click JavaScript events such as mouseover/mouseout and focus/blur. Clicking a button to open a hint popover would cause an open auto popover to light-dismiss.

"manual"

manual popovers cannot be "light dismissed" and are not automatically closed. Popovers must explicitly be displayed and closed using declarative show/hide/toggle buttons or JavaScript. Multiple independent manual popovers can be shown simultaneously.

Examples

Feature detection

You can use the popover attribute to feature detect the Popover API:

js
function supportsPopover() {
  return Object.hasOwn(HTMLElement.prototype, "popover");
}

Setting up a popover programmatically

js
const popover = document.getElementById("mypopover");
const toggleBtn = document.getElementById("toggleBtn");

const popoverSupported = supportsPopover();

if (popoverSupported) {
  popover.popover = "auto";
  toggleBtn.popoverTargetElement = popover;
  toggleBtn.popoverTargetAction = "toggle";
} else {
  console.log("Popover API not supported.");
}

Specifications

Specification
HTML
# dom-popover

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
popover
Chrome – Full support
Chrome 114 (Release date: 2023-05-30)
footnote Full support
Edge – Full support
Edge 114 (Release date: 2023-06-02)
footnote Full support
Firefox – Full support
Firefox 125 (Release date: 2024-04-16)
footnote Full support
Opera – Full support
Opera 100 (Release date: 2023-06-29)
footnote Full support
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – Full support
Chrome Android 114 (Release date: 2023-05-30)
footnote Full support
Firefox for Android – Full support
Firefox for Android 125 (Release date: 2024-04-16)
footnote Full support
Opera Android – Full support
Opera Android 76 (Release date: 2023-06-26)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 17 – 18.2 (Release date: 2023-09-18)
footnote Partial support
footnote On iOS and iPadOS, popovers are not dismissed when the user taps outside of the popover area, see bug 267688.
Safari on iOS – Full support
Safari on iOS 18.3 (Release date: 2025-01-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 23 (Release date: 2023-10-18)
footnote Full support
WebView Android – Full support
WebView Android 114 (Release date: 2023-05-30)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 17 – 18.2 (Release date: 2023-09-18)
footnote Partial support
footnote On iOS and iPadOS, popovers are not dismissed when the user taps outside of the popover area, see bug 267688.
WebView on iOS – Full support
WebView on iOS 18.3 (Release date: 2025-01-27)
footnote Full support
hint value
Chrome – Full support
Chrome 133 (Release date: 2025-02-04)
footnote Full support
Edge – Full support
Edge 133 (Release date: 2025-02-06)
footnote Full support
Firefox – Full support
Firefox 149 (Release date: 2026-03-24)
footnote Full support
Opera – Full support
Opera 118 (Release date: 2025-04-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 133 (Release date: 2025-02-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 149 (Release date: 2026-03-24)
footnote Full support
Opera Android – Full support
Opera Android 88 (Release date: 2025-03-19)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 29 (Release date: 2025-10-25)
footnote Full support
WebView Android – Full support
WebView Android 133 (Release date: 2025-02-04)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Has more compatibility info.

See also