HTMLElement: togglePopover() method

The HTMLElement.togglePopover() method opens an element that has a valid popover attribute.

When togglePopover() is called on an element with the popover attribute that is currently hidden, then a beforetoggle cancelable event will be fired, followed by the popover opening and a toggle event being fired.

If the element is already open, then a beforetoggle non-cancelable event will be fired followed by the popover closing and a toggle event being fired.

Syntax

togglePopover()

Parameters

None.

Return value

None (undefined).

Specifications

Specification
HTML Standard
# dom-togglepopover

Browser compatibility

BCD tables only load in the browser

See also