i have a dynamically created list with data of a json. So my question is how to get the index of a clicked item.
I tried this:
$("li").click(function() {
var index = $("li").index(this);
alert(index); });
But this didnt work. I dont get an alert? If i create some static Li elements, i get the index of them.
Please help me :/