YouTip LogoYouTip

Event Ontoggle

# ontoggle Event [![Image 3: Event Object Reference](#) Event Object](#) ## Example Execute JavaScript when the
element is opened or closed:
[Try it Β»](#) * * * ## Definition and Usage The ontoggle event occurs when a user opens or closes a
element. The
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: _object_.ontoggle=function(){_myScript_};(#) In JavaScript, using the addEventListener() method: _object_.addEventListener("toggle", _myScript_);(#) **Note:** Internet Explorer 8 and earlier IE versions do not support the [addEventListener()](#) method. * * * Technical Details | Bubbles: | No | | --- | | Cancelable: | No | | Event type: | Event | | Supported HTML tags: |
| * * Event Object](#)
← Angularjs ScopesEv Ontoggle β†’