Loading...
<a href="#" popovertarget="info">Info</a>
<div id="info" popover>...</div><button popovertarget="info">Info</button>
<div id="info" popover>...</div>popovertarget only works on buttons, so the link is replaced with a <button>.
popovertarget on an <a> element, where it does nothing.id of an element that has the popover attribute.popovertarget is on a <button> or <input type='button'>, not on a link or a <div>.popovertargetaction is 'toggle', 'show' or 'hide', and defaults to 'toggle'.aria-expanded, the browser exposes the state itself.Add a button with the same popovertarget and popovertargetaction='hide'.
Yes. The button shows, hides or toggles the popover with no script.
popovertarget controls only popovers. commandfor with command can also open dialogs and run custom commands.