Favorites

HTML popovertarget Attribute

popovertarget
HTML AttributeThis attribute is supported by all modern browsers.
Updated 22nd November 2026

The popovertarget attribute turns a button into a control for a popover, naming the popover element by its id.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The popovertarget attribute turns a <button> (or an <input type="button">) into a popover control. Its value is the id of the popover element that the button shows, hides or toggles when it is activated.

Popovers are elements with the global popover attribute. They are shown in the top layer above other content and, by default, close automatically when the user clicks outside them or presses Esc. The popovertarget and popovertargetaction attributes let a button open and close a popover without any JavaScript.

The button is also the implicit anchor of the popover for CSS anchor positioning, and the browser exposes the relationship to assistive technology.

Syntax

<button popovertarget="id">

Values

  • idThe id of an element with the popover attribute.

Applies To

Example

<button popovertarget="info">Toggle info</button>
<button popovertarget="info" popovertargetaction="hide">Hide</button>
<div id="info" popover>This is a popover.</div>
Open in editor

Browser Support

The following information will show you the current browser support for the HTML popovertarget attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.

This attribute is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee