Can't get attributes from ajax response...

Can't get attributes from ajax response...


Hi ,
I'm making a ajax call using $.ajax
my code is
$.ajax({
type: "POST",
url: "sample.php",
dataType:"html",
data: "name="+$('#name').val(),
success: function(msg){
$('#result').append(msg);
}
});
And the response is
<a href="#" id="1123" class="user-link">User1</a>
When i try to get the Id from the response, it's seems not working..
$('.user-link').click(function(){
alert($(this).attr('id'));
});
And i need to make this work urgently...
Any help will be greatly appreciated...
Thanks in advance...