HTML popovertarget Attribute
The popovertarget attribute turns a button into a control for a popover, naming the popover element by its id.
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
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.
Desktop





Tablets & Mobile





