View HTML text on Twitter-Bootstrap Popover

3

I created a Popover provided by Twitter-Bootstrap in this Popover a message formatted with HTML tags is displayed, however when I open the page the text that should be formatted in HTML is formatted as texto plano how do I display it formatted in HTML?

Popover Code

$("#pass_ca").popover({
    title:'A senha deve conter entre 8 e 16 caracteres, incluindo:',
    content:'<ul><li>Letras Maiusculas</li><li>Letras Minusculas</li><li>Numeros</li></ul>',
    trigger:'hover',
    placement:'right'
});

Tag that has popover

<input type="password" name="password" class="form-control" placeholder="Senha" id="pass_ca">
    
asked by anonymous 28.07.2015 / 15:53

2 answers

4

Add html: true to popover setting:

$("#pass_ca").popover({
    title:'A senha deve conter entre 8 e 16 caracteres, incluindo:',
    content:'<ul><li>Letras Maiusculas</li><li>Letras Minusculas</li><li>Numeros</li></ul>',
    trigger:'hover',
    placement:'right',
    html: true
});

See running on JsFiddle .

The value for default of html is false, which causes the function text of jQuery to be used to validate the text of popover .

    
28.07.2015 / 16:11
2

Alternatively, insertion of the html: true into the object passed to popover can insert a data-html="true" attribute directly into the tag that will contain popover .

<input type="password" name="password" class="form-control" placeholder="Senha" id="pass_ca" data-html="true">
    
28.07.2015 / 16:22