Tell me why the tooltip does not work?

<input id="name-send" name="name" class="input-people" placeholder="ВАШЕ ИМЯ" data-toggle="tooltip" data-placement="left" title="• поле Имя обязательно для заполнения• длина имени должна составлять не менее двух символов • поле должно содержать только русские или латинские буквы"><br> if($("#name-send").hasClass('error')) { $('#name-send').css('border','1.5px solid red').tooltip('show'); }else{ $('#name-send').css('border','1.5px solid green'); } 
  • Somehow weird you have a script declared in the middle of the html-code. Hope this is for an example? If so, post it separately and completely. - Mik
  • There is too much code there, so I’ll not post it completely (The bottom line is that you need to show the tooltip based on the condition - ChromeChrome
  • how exactly does not work? shows an error in the console? doing nothing? doing something not what was expected? Do you enter the if($("#name-send").hasClass('error')) condition? perhaps at the time of the call from the input, there is simply no class error - Grundy

1 answer 1

It also depends on the version of the bootstrap, for example, in 4 you need the tether.js file. Check if there are any errors in the console.