$(selector).index(element)
<ul class="indextest"> <li> <div>0</div> </li> <li> <div>1</div> </li> <li> <div>2</div> </li> <li> <div>3</div> </li> <li> <div>4</div> </li> </ul>
$('.indextest div').click(function(event) { /* Act on the event */ console.log($(this).index('.indextest div')); });