Javascript examples for DOM Event:ontoggle
The ontoggle event occurs when the user opens or closes the <details> element.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <details> |
<!DOCTYPE html> <html> <body> <details ontoggle="myFunction()"> <summary>Copyright 2018-2020.</summary> <p> - by java2s.com.</p> </details>//from w ww . ja v a2 s . co m <script> function myFunction() { console.log("The ontoggle event occured"); } </script> </body> </html>