showPopover()

Shows a popover.

Published on Updated on

The showPopover() instance method of the Element interface shows a popover element.

Syntax

showPopover()

Parameters

None.

Return value

Void.

Exceptions

NotSupportedError DOMException
Thrown if showPopOver() is called on an element that does not have a valid value of the popover attribute set on it.
InvalidStateError DOMException
Thrown if showPopOver() is called on a valid popover that is already shown.
InvalidStateError DOMException
Thrown if showPopOver() is called on a valid popover that is not connected to a document.

Example

const popover = document.getElementById('my-popover');
popover.showPopOver();

Browser compatibility

See also

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.