Expand/Collapse Widget Examples

Example 1: Basic FAQ Item

JavaScript is a programming language that enables interactive web pages. It is primarily used for client-side scripting, but can also be used server-side with environments like Node.js.

Example 2: Product Features

Example 3: Additional Information

This content is shown by default. You can collapse it by clicking the button again. The expand/collapse functionality works by toggling the 'expanded' class on the details container.

The JavaScript function checks the current state and either shows or hides the content accordingly.