我在 Bootstrap3 的“popover”中工作。在这里,我放置了如下 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。谁能给我解释一下?