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/newState below:

ToggleEvent: newState property - Web APIs

ToggleEvent: newState property

Baseline 2023

Newly available

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

Value

A string. Possible values are "open" (the popover is being shown) or "closed" (the popover is being hidden).

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

// …

popover.addEventListener("beforetoggle", (event) => {
  if (event.newState === "open") {
    console.log("Popover is being shown");
  } else {
    console.log("Popover is being hidden");
  }
});
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