You need to pass event object to function to get the item that triggered the event, event.target will give you the source element.
Live Demo
$('#p').bind('click', function(event) {
alert(event.target.id);
});
or
Live Demo
$('#p').bind('click', function(event) {
alert($(event.target).attr('id'));
});
Edit
The first method event.target.id is preferred over second $(event.target).attr('id') for performance, simplicity and readability.