HTML ontoggle Event Attribute

The HTML ontoggle event attribute is triggered when a user opens or closes the

HTML element in an HTML document.

Syntax

Following is the syntax ?

Content

Let us see an example of HTML ontoggle event Attribute ?

Example






HTML ontoggle Event Attribute Demo

Hi! I'm summary element

This is a paragraph with some dummy content.

Output

Now try to open the details HTML element to observe how ontoggle event attribute works.

Updated on: 2026-03-11T22:50:45+05:30

227 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements