HTML popovertarget Attribute
Definition and Usage
With the popovertarget
attribute you can refer to the popover element with the
specified id, and toggle between showing and hiding it:
Hello
The popovertarget
only works when type="button".
Applies to
The popovertarget
attribute can be used on the following elements:
Elements | Attribute |
---|---|
<input> | popovertarget |
<button> | popovertarget |
Example
Example
Refer to a popover element with the popovertarget attribute to show/hide the specified popover element:
<h1 popover id="myheader">Hello</h1>
<input type="button" popovertarget="myheader" value="Click me!">
Try it Yourself »
Browser Support
Attribute | |||||
---|---|---|---|---|---|
popovertarget | 114 | 114 | Not supported | 17 | 100 |
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.