I would like to show tooltip when input.val().length <= 3 then hide tooltip when > 3 chars
Check this out:
<input type="text" id="nav-search"/>
$('#nav-search').on('keyup',function(){
var _keys = $(this).val();
if(_keys.length <= 3){
$(this).tooltip({'trigger':'focus',position:'right'});
$(this).trigger('focusin');
}
});
it doesn’t works obviously :/
Theoretically, it should work:
Practically, it works.
DEMO: http://jsfiddle.net/FvxnN/