<ul>
<li>Picture 1</li>
<li>Picture 2</li>
<li>Picture 3</li>
<li>Picture 4</li>
<li>Picture 4</li>
</ul>
// code snippet 1
$("li").click(function () {
console.log($(this).index()); // 0
});
// code snippet 2
$("li").click(function () {
console.log($("li").index(this)); // 0 , 1 ,2..
});