I have an input field. On its focusin event I am opening a tooltip and on its focuout I am closing the tooltip. But now I am having a link on tooltip and what I want to do to make that link clickable. But when I start focusing input and go to that tooltip link and try to click than the input's focusout event gets called first and the tooltip gets closed. So I was unable to click that link. Here is my code :
html:
<div class="block"><input type="text" class="field-input"/><div class="tooltip">
<a href="#">tooltip link</a></div>
css:
.block{position:relative;}.tooltip{position:absolute;right:0;display:none;bottom:0;}
jquery:
$('.field-input').on('focusin', function(){
$('tooltip').show();
});
$('.field-input').on('focusout', function(){
$('tooltip').hide();
});
$('.tooltip a').on('click', function(){
... do something
});