jQuery has powerful selectors , so usually you do not need to check the index after the event. For example:
For the first div on your page:
$(".list-wrapper:first").click(doSomething);
For the first <li>in each list:
$(".list-wrapper li:first-child").click(doSomething);
, div li. , .list-wrapper div - div list-wrapper. :
var parent = $(this).closest('div')
var index = $(".list-wrapper").index(parent);