javascript - 我可以在 Twitter Bootstrap 的工具提示中使用复杂的 HTML 吗?

标签 javascript html twitter-bootstrap-3 tooltip

如果我检查 official documentation ,我可以看到一个叫做 HTML 的属性:

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.

上面写着“将 html 插入工具提示”,但类型是 bool 值。如何在 Tooltip 中使用复杂的 html?

最佳答案

这个参数只是关于你是否要在工具提示中使用复杂的html。设置为 true然后将html打入title标签的属性。

看这个 fiddle here - 我通过 data-html="true" 将 html 属性设置为 true在 <a>标记,然后只是添加在 html ad hoc 中作为示例。

关于javascript - 我可以在 Twitter Bootstrap 的工具提示中使用复杂的 HTML 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13704789/

相关文章:

javascript - 如何根据元素的宽度改变背景颜色?

javascript - 如何在元素外部单击时隐藏div

html - anchor 标记不适用于图像悬停效果

html - <a> bootstrap 轮播中的 glyphicon 相互堆叠,我该如何消除这种行为?

javascript - 当我在 HTML 中调用它时,为什么我的 Javascript 函数不运行/工作?

javascript - 当用户单击 href "#"的链接时显示 <div>

jquery - 使 Bootstrap 3 选项卡响应式

html - 使 Bootstrap 切换菜单的 CSS 过渡平滑

javascript - 动态合并对象 - 对象属性名称问题

html - 为什么前两个图标的行高在 chrome 中不起作用?