Try this:
$(document).ready(function(){
$('ul li').click(function(){
alert($(this).index());
});
});
If you want to read over all the elements in the list you can use:
$(document).ready(function(){
$('ul li').each(function(){
alert($(this).index());
});
)};
Hope this helps.