Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create an accordion menu that expands and collapses sections.

Medium

Problem Statement

Create an accordion menu that expands and collapses sections.

Sample Output

Clicking an accordion item expands it to show hidden content.

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

<!DOCTYPE html> <html> <head> <style> /* Add CSS here to style the accordion menu */ </style> </head> <body> <div class="accordion"> <div class="item"> <button class="toggle">Item 1</button> <div class="content">Content for Item 1</div> </div> <div class="item"> <button class="toggle">Item 2</button> <div class="content">Content for Item 2</div> </div> </div> </body> </html>

Document

To view the HTML changes, please type the code within the editor