The selectedIndex() method returns a list of numeric values (zero-based indeces), specifying the selected item context 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="contextmenu1">

<script type="text/javascript">

    $(function () {
             target: "body"

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

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

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