Easy Tutorial
❮ Event Onmouseout Dom Obj Image ❯

ontoggle Event

Event Object

Example

Execute JavaScript when a <details> element is opened or closed:


Definition and Usage

The ontoggle event is triggered when the user opens or closes a <details> element.

The <details> element describes additional information that the user can view or hide as needed.


Browser Support

The numbers in the table specify the first browser version that fully supports the event.

Event
ontoggle 12.0 Not supported Not supported 6.0 15.0

Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Bubbles: No
Cancelable: No
--- ---
Event type: Event
--- ---
Supported HTML tags: <details>
--- ---
❮ Event Onmouseout Dom Obj Image ❯