Here's main part of html:
<div id="table"> <div class="table_item">asd</div> <div class="table_item">asd</div> <div class="table_item">asd</div> </div> And JS (JQuery):
$(document).ready( function() { $(".table_item").click( function() { alert($("#table").index($(this))); }); }); click handling works but I ALWAYS get -1 from .index.
trying simply $(this).index(); shows the same result.
Please help! What's wrong with the code?