ontoggle event
Examples
<Details> element in the implementation of JavaScript when opening or closing:
<Details ontoggle = "myFunction ()">
try it"
Definition and Usage
ontoggle event is triggered when the 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 | |||||
---|---|---|---|---|---|
ontoggle | 12.0 | not support | not support | 6.0 | 15.0 |
grammar
In HTML:
<Elementontoggle = "myScript"> try
In JavaScript:
object .ontoggle = function () {myScript }; try
JavaScript, use the addEventListener () method:
object .addEventListener ( "toggle", myScript ); try
Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.
technical details
Whether to support the bubble: | No |
---|---|
It can be canceled: | No |
Event Type: | Event |
Supported HTML tags: | <Details> |
Event objects