admin管理员组文章数量:1389955
Following the documentation, I need to display some HTML inside a bootstrap 5 tooltip.
However, copy pasta from the doc does not give the expected output.
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
Here is a jsfiddle.
Instead of displaying parsed HTML, HTML is parse as text.
How can I display content as HTML instead of text ?
Following the documentation, I need to display some HTML inside a bootstrap 5 tooltip.
However, copy pasta from the doc does not give the expected output.
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
Here is a jsfiddle.
Instead of displaying parsed HTML, HTML is parse as text.
How can I display content as HTML instead of text ?
Share Improve this question asked Sep 3, 2021 at 8:59 Itération 122442Itération 122442 2,9823 gold badges41 silver badges91 bronze badges 1-
1
You are using Bootstrap5, yet you are working off of the documentation for version 4. The attribute enabling HTML content needs to be
data-bs-html="true"
– C3roe Commented Sep 3, 2021 at 9:10
1 Answer
Reset to default 6In Bootstrap v5.0 you should use data-bs-html="true"
.
<button type="button" class="btn btn-secondary" data-bs-toggle="tooltip" data-bs-html="true" title="<em>Tooltip</em> <u>with</u> <b>HTML</b>">
Tooltip with HTML
</button>
Your JSFiddle.
本文标签: javascriptHTML inside bootstrap 5 tooltipStack Overflow
版权声明:本文标题:javascript - HTML inside bootstrap 5 tooltip - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744576313a2613646.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论