I have a problem - I put a piece of html code on the page using jQuery Ajax
example code:
<ul id="income">
<li id="1"><p>a1</p></li>
<li id="2"><p>a2</p></li>
<li id="3"><p>a3</p></li>
</ul>
I would like to know which element (id) was clicked by the user. Unfortunately, the following code does not work :(
$('li').click(function(){
var info = $(this).attr('id');
alert(info);
});
It seems to me that the problem stems from serving html with ajax. jQuery can not see it?