Element: popoverhide event

Fired on the popover when it is dismissed.

Published on Updated on

The popoverhide event of the Element interface fires on a popover element when it is dismissed.

Syntax

Use the event name in methods like addEventListener(), or set the equivalent event handler property.

addEventListener("popoverhide", (event) => {});
onpopuphide = (event) => {};

Example

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

// Event listener version
popover.addEventListener('popoverhide', () => {
popoverToggleBtn.textContent = 'Show popover';
})

// Event handler property version
popover.onpopoverhide = () => {
popoverToggleBtn.textContent = 'Show popover';
}

Browser compatibility

See also

Updated on Improve article

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