Element: popoverhide event

Fired on the pop-up when it is dismissed.

Published on Updated on

The popoverhide event of the Element interface fires on a pop-up 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 popup = document.getElementById('my-popup');
const popupToggleBtn = document.getElementById('my-popup-btn');

// Event listener version
popup.addEventListener('popoverhide', () => {
popupToggleBtn.textContent = 'Show pop-up';
})

// Event handler property version
popup.onpopoverhide = () => {
popupToggleBtn.textContent = 'Show pop-up';
}

Browser compatibility

See also

Updated on Improve article

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