A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/ToggleEvent/oldState below:

ToggleEvent: oldState property - Web APIs

ToggleEvent: oldState property

Baseline 2023

Newly available

The oldState read-only property of the ToggleEvent interface is a string representing the state the element is transitioning from.

Value

A string. Possible values are "open" (the popover is going from showing to hidden) or "closed" (the popover going from hidden to shown).

Examples
const popover = document.getElementById("mypopover");

// …

popover.addEventListener("beforetoggle", (event) => {
  if (event.oldState === "open") {
    console.log("Popover is being hidden");
  } else {
    console.log("Popover is being shown");
  }
});
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3