ToggleEvent Class

https://html.spec.whatwg.org/multipage/interaction.html#toggleevent

public sealed class ToggleEvent : Event
Inheritance
Event ToggleEvent

Constructors

NameDescription
ToggleEvent(string, ToggleEventInit?)Creates a toggle event with the given type and initialization dictionary.

ToggleEvent(string, ToggleEventInit?)

HtmlEvents.cs

Creates a toggle event with the given type and initialization dictionary.

public ToggleEvent(string type, ToggleEventInit? eventInitDict = null)

Properties

NameDescription
NewStateGets the state of the element after the toggle.
OldStateGets the state of the element before the toggle.
Sourcehttps://html.spec.whatwg.org/multipage/interaction.html#dom-toggleevent-source: the source retargeted against the current target.

Gets the state of the element after the toggle.

public string NewState { get; }

Gets the state of the element before the toggle.

public string OldState { get; }

https://html.spec.whatwg.org/multipage/interaction.html#dom-toggleevent-source: the source retargeted against the current target.

public Element? Source { get; }