How to know the index of Listview without clicking

How to know the index of Listview without clicking

Hello everyone

 $("#RecipeList").on('click', 'li', function(){
           alert($(this).index())

});

this code is gettng the index of lsitview who has clicked. I want to ask if theres a way to know the index of listview without clicking it.

Thanks