HTML <button> popovertarget attribute

Definition and usage

By using popovertarget Attribute, you can refer to the popup element with the specified id and switch between displaying and hiding:

Hello

See Also:

HTML Reference Manual:HTML popover attribute

HTML Reference Manual:HTML Button popovertargetaction Attribute

Example

To display/hide a specified popup element, refer to the popup element that has the popovertarget attribute:

<h1 popover id="myheader">Hello</h1>
<button popovertarget="myheader">Click me!<button>

Try It Yourself

Syntax

<button popovertarget="element_id">

Attribute Value

Value Description
element_id The id of the popup element associated with the button.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
114 114 Not Supported 17 100