Given a dynamically built list such as :
<ul id="shortcuts">
<li><input type="checkbox" value="false"/><button>foo</button><button>-</button></li>
<li><input type="checkbox" value="false"/><button>foo</button><button>-</button></li>
<!-- possibly many others lis -->
</ul>
So in order to use only one click event listener, I am trying to attach click event to the list and get the list item index that initially spread the event. Any of my attempts succeed so far.
I can get something out of this :
$("#shorcuts").click ( function(evt) {
alert( evt.target );
});
But I can't get to the "li" html element nor its "index" within the list. Any idea what I am doing wrong ?