Make tooltip read html tag

2

I'm using the jQuery tooltip and need to display a message formatted with html, for example

$(function(){
  $("input:file").tooltip();
});
<link href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scriptsrc="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<input type='file' title="<b>m</b>ensagem <i>formatada</i>">

I would like him to understand the html

    
asked by anonymous 05.02.2016 / 16:34

1 answer

3

I think this script would solve

In the jQuery tooltip you can use:

 $(function() {
       var el = $("input:file");
       var msg = el.attr('title');
       el.tooltip({
          content : msg
       });
    });

In Bootstrap you can use:

 $(function() {
      var el = $("input:file");
      el.tooltip({
          html : true
      });
 });
    
05.02.2016 / 16:46