HTML popovertargetaction Attribute
Definition and Usage
The popovertargetaction attribute
defines what happens to the targeted popover element when you click the button.
Legal values are: "show", "hide", and "toggle".
If the popovertargetaction attribute is not specified, the default "toggle" value is used.
Applies to
The popovertargetaction attribute can be used on the following elements:
| Elements | Attribute |
|---|---|
| <input> | popovertargetaction |
| <button> | popovertargetaction |
Example
Example
Create two buttons: one for "Show" popover, and one for "Hide" popover:
<button popovertarget="tip1" popovertargetaction="show">Show</button>
<button popovertarget="tip1" popovertargetaction="hide">Hide</button>
<div id="tip1" popover>
Here we can show a helpful tip.
</div>
Try it Yourself »
Browser Support
| Attribute | |||||
|---|---|---|---|---|---|
| popovertargetaction | 114 | 114 | 125 | 17 | 100 |