BOOTSTRAP tooltip for input element only if input length val <n
I would like to show a hint when input.val().length <= 3 then hide the hint when> 3 characters
Check this:
<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 does not work explicitly: /
+4
2 answers