You need to use event.stopPropagation()
Live Demo
$('#childDiv').click(function(event){
event.stopPropagation();
alert(event.target.id);
});
event.stopPropagation()
Description: Prevents the event from bubbling up the DOM tree,
preventing any parent handlers from being notified of the event.