[jQuery] Why I can't access to "a" tag in a div

[jQuery] Why I can't access to "a" tag in a div


$(document).ready(function(){
$.ajax({
type: "GET",
url: "news.php",
success: function(msg){
$("#response").fadeIn("slow").html(msg);
}
});
$("a#response").click(function(){
alert("Hello");
return false;
});
});
<body>
<div id="response"></div>
</body>
</html>
in "response" appear the data from $.ajax, a simple list of record :
<a href="pippo?id=1">
<a href="pippo?id=2">
<a href="pippo?id=3">
Why I can't access to the "click" event of the "a" tag in "response"
div?
--
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
"It's easier to invent the future than to predict it." -- Alan Kay


























    • Topic Participants

    • max