![]() |
Definition and UsageThe The Applies toThe
Browser SupportThe numbers in the table specify the first browser version that fully supports the event attribute. |
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<p>Open the details.</p>
<details ontoggle="myFunction()">
<summary>Copyright 1999-2014.</summary>
<p> - by Refsnes Data. All Rights Reserved.</p>
<p>All content and graphics on this web site are the property of the company Refsnes Data.</p>
</details>
<script>
function myFunction() {
alert("The ontoggle event occured");
}
</script>
</body>
</html>
html ontoggle attribute |
How to Execute a JavaScript when a <details> element is opened or closed - HTML ontoggle Attribute | HTML Attribute |
Read Full: | HTML Attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |
Views: | 43 |
Reffered: https://www.w3schools.com/tags/att_ontoggle.asp