Wijmo UI for the Web
Accordion Markup and Scripting
Wijmo User Guide > Widgets > Accordion > Accordion Markup and Scripting

The HTML markup for a wijaccordion widget looks like this, with multiple sets of header area and content area elements.

Note: The content area element immediately follows the corresponding header area element.
Markup
Copy Code
<div id="accordion">
        <h3>header</h3>
        <div>content</div>
        <h3>header</h3>
        <div>content</div>
        <h3>header</h3>
        <div>content</div>
</div>

You can initialize the widget with the following jQuery script.

Script
Copy Code
<script id="scriptInit" type="text/javascript">
    require(["wijmo.wijaccordion"], function () {
        $(document).ready(function () {
            $("#accordion").wijaccordion();
        });
    });
</script>

The markup and script featured here results in the following live widget. Mouse over Accordion to see the animation.

See Also

Widgets