The selectedIndex() method returns a list of numeric values (zero-based indeces), specifying the selected item menu level.
For example, a return list of [3, 2] specifies that the fourth element from the first menu and the 3rd from the secondary sub menu should is selected.

<ul id="menu1">

<script type="text/javascript">

    $(function () {
             width: "100px"

        var menu = $("#menu1").swidget();

        //select Save option of the Menu widget
        menu.selected(true, 1);

        //Save option is selected - selectedIndex will return [1]
        var selectedIndex = menu.selectedIndex();