hidePopover()

Dismisses a popover.

Published on Updated on

The hidePopover() instance method of the Element interface dismisses a popover element.

Syntax

hidePopover()

Parameters

None.

Return value

Void.

Exceptions

NotSupportedError DOMException
Thrown if hidePopover() is called on an element that does not have a valid value of the popover attribute set on it.
InvalidStateError DOMException
Thrown if hidePopover() is called on a valid popover that is not currently showing.

Example

const popover = document.getElementById('my-popover');
popover.showPopOver(); // needs to be shown first

...

popover.hidePopover();

Browser compatibility

See also

Updated on Improve article

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