Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a word bold in a text mentioned in bootstrap tooltip CSS/Jquery

I am trying to show a bootstrap tooltip on hover over an image. I have a text in that tooltip that i need to make it bold.

I tried this from the mentioned source, but didnt work form me..

  <button class="infoTipsBox" type ="button" data-toggle="tooltip" data-placement="right"data-original-title='<b>big tooltip</b>'>      
  </button>

Js:

$(function () {
        $('[data-toggle="tooltip"]').tooltip();
    });

What im i doing wrong?? In the above text in the title attribute, I am trying to make the "bootstrap tooltip" in bold font and rest in normal font. How can i achieve this?

like image 940
user1234 Avatar asked Jun 25 '15 05:06

user1234


1 Answers

As you can see in Bootstrap' official documnetation for tooltip

Name    |    Type       |    default  |    Description
----------------------------------------------------------------------------
html    |    boolean    |    false    |    Insert html into the tooltip. 
                                           If false, jquery's text method 
                                           will be used to insert content 
                                           into the dom. Use text if you're 
                                           worried about XSS attacks.

so, add data-html="true" to your tooltip and this will enable HTML in your tooltip

like image 89
Arpit Goyal Avatar answered Oct 13 '22 00:10

Arpit Goyal