Element: popovershow event

Fired on the popover when it is shown.

Published on Updated on

The popovershow event of the Element interface fires on a popover element when it is shown.

Syntax

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

addEventListener("popovershow", (event) => {});
onpopovershow = (event) => {};

Example

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

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

// Event handler property version
popover.onpopovershow = () => {
popoverToggleBtn.textContent = 'Dismiss 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.