Horje

How to add HTML <input> popovertarget Attribute

Refer to a popover element with the popovertarget attribute to show/hide the specified popover element:

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:

The popovertarget only works when type="button".

Browser Support

Syntax

<input type="button" popovertarget="element_id">


Attribute Values

Value Description
element_id The id of the popover element related to this button
index.html
Example: HTML
<h1 popover id="myheader">Hello</h1>
<input type="button" popovertarget="myheader" value="Click me!"> 

Output should be:

How to add HTML <input> popovertarget Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin