Use the addEventListener() method to attach a "toggle" 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.