Latest web development tutorials

HTML ontoggle event properties

HTML Attributes HTML Event Attributes

Examples

<Details> element in the implementation of JavaScript when opening or closing:

<Details ontoggle = "myFunction ()">

try it"

Definition and Usage

ontoggle property is triggered when a user opens or closes <details> element.

<Details> element describes additional information, according to the needs of the user can view or hide it.


Browser Support

Figures in the table represent the first browser to support this version of events.

Event Properties
ontoggle 12.0 not support not support 6.0 15.0


The difference between HTML 4.01 and HTML5

ontoggle HTML5 attribute is new.


grammar

<Elementontoggle = "script">

Property Value

value description
script The script is executed ontoggle
technical details
Supported HTML tags: <Details>


Related Pages

HTML DOM Reference: ontoggle event


HTML Attributes HTML Event Attributes