Course Recommendation:
HTML <input> popovertargetaction attribute
popovertargetaction
Definition and Usage
attribute allows you to define what happens when you click the button. You can define what happens when you click the button using the
"show"(Show),
"hide" "toggle"
(Hide) and
popovertargetaction
choose between these values. (Toggle) attribute is only available in
type="button"
it is valid when popovertargetaction
If the attribute is not specified, "toggle"
Value.
See also:
HTML Reference Manual:HTML popover attribute
HTML Reference Manual:HTML Input popovertarget attribute
Example
When the input button is clicked, the popup element will display:
<h1 popover id="myheader">Hello</h1> <input type="button" popovertarget="myheader" popovertargetaction="show" value="Click Me!">
Syntax
<input type="button" popovertarget="element_id"popovertargetaction="hide|show|toggle">
Attribute Value
Value | Description | Example |
---|---|---|
hide | When you click the button, the popup element is hidden. | |
show | When you click the button, the popup element is displayed. | |
toggle | Default value. When you click the button, the popup element will toggle between hidden and visible. |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
114 | 114 | Not Supported | 17 | 100 |