Favorites

HTML popovertargetaction Attribute

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

The popovertargetaction attribute sets what a popover control button does: toggle (the default), show or hide.

☕
Enjoying this site?

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

Buy us a coffee

Description

The popovertargetaction attribute sets what a popover control button does to the popover named in its popovertarget attribute: toggle it (the default), only show it, or only hide it.

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.

Syntax

<button popovertarget="id" popovertargetaction="toggle | show | hide">

Values

  • toggleThe default. Shows the popover if it is hidden, hides it if it is showing.
  • showOnly shows the popover.
  • hideOnly hides the popover.

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 popovertargetaction 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