6

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?

user1234
  • 3,000
  • 4
  • 50
  • 102

1 Answers1

9

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

Arpit Goyal
  • 1,017
  • 12
  • 25