Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The beforetoggle event of the HTMLElement interface fires on a popover element (i.e. one that has a valid popover attribute) just before it is shown or hidden.
- If the popover is transitioning from hidden to showing, the
event.oldStateproperty will be set toclosedand theevent.newStateproperty will be set toopen. - If the popover is transitioning from showing to hidden, then
event.oldStatewill beopenandevent.newStatewill beclosed.