Accordiont to always select the first item?

Accordiont to always select the first item?


I've a problem related to my project, since accordion when I click, it
shows the related sub menu (eg. in my case an <ul>), it memorizes the
previous activated state of the submenu's item (in my case an <li>
element).
I'm wondering if there is a way to teach acccordion to always activate
the first element of the submenu (deactivate the previous activated
submenu and activate the first, it only consist on a css class, but I
don't know what option to use or where this function is handle by the
code).