When the button is clicked, the popover element will show.
The popovertargetaction
attribute allows you to define what happens when you click the button.
You can choose between the values "show", "hide", and "toggle".
<button popovertarget="element_id popovertargetaction="hide|show|toggle"">
Value | Description | |
---|---|---|
hide | The popover element is hidden when you click the button |
show | The popover element is showed when you click the button | |
toggle | Default value. The popover element is toggled between hidding and showing when you click the button |
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The button popovertargetaction Attribute</h1>
<h1 popover id="myheader">Hello</h1>
<button popovertarget="myheader" popovertargetaction="show">Show popover</button>
<p>Click the button and it will show the popover element.</p>
</body>
</html>
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded by: | Admin |