【发布时间】:2015-10-08 10:06:27
【问题描述】:
我在 Bootstrap3 的“弹出框”中工作。在这里,我放置了如下 HTML 内容,
<a href='#' class='btn' title ='Test' data-trigger='focus' data-
toggle='popover' data-html='true' id = 'testOutside' data-content='<a
href="#" id="testInside" class="btn">Inside</a>'>Click Here </a>
我无法引用 data-content 属性中的 html 元素。
如下所示,
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
// the below is not working
$('#testInside').click(function(){
alert('Inside');
});
$('#testOutside').click(function(){
alert('Outside');
});
});
但是引导类被应用了,在这种情况下,“btn”被应用到锚标签。附加jsFiddle。谁能给我解释一下?
【问题讨论】:
-
你的问题很模糊。
标签: jquery html twitter-bootstrap popover bootstrap-popover