I have a case where on clicking a link, I am showing a tooptip. I want to hide the tool tip when the user clicks anywhere else on the screen(even some other link). Below is the code I have...
$('a.tooltip').click(function(event){
$('a.tooltip span').hide();
$(this).children("span").show();
});
The above function shows/hide the tooltips when clicked on the a tags.
$(document).click(function(event){
if(event.target != 'a.pull-right plus tooltip'){
$('a.tooltip span').hide();
}
});
Since event.target gives me the entire HTML target, I am not able to distinguish between clicks. Is there some way to do this?