Use the HTML DOM to assign an "ontoggle" event to a details element.
Open the details.
- by W3Schools. All Rights Reserved.
All content and graphics on this web site are the property of W3Schools.