Interactive Elements

popovertargetaction="toggle"

Build a form with the HTML form generator

Alternates between showing and hiding the popover named by popovertarget. This is the default action for a compatible invoker when omitted or invalid. On compatible button and input controls with popovertarget; missing or invalid values default to toggle.

Formal Syntax & Structure

html syntaxhtml
popovertargetaction="toggle"

Parameters & Attributes

NameTypeDescription
popovertargetactionkeywordAlternates between showing and hiding the popover named by popovertarget. This is the default action for a compatible invoker when omitted or invalid.
popovertargetelement IDIdentifies the popover to control.

Working Example

Example Snippethtml
<button type="button" popovertarget="note" popovertargetaction="show">Open note</button><button type="button" popovertarget="note" popovertargetaction="toggle">Toggle note</button><div id="note" popover="manual">A contextual note.</div>
HTML Reference