如果我有这个弹出框代码:
$('.UofTennesseeKnox').popover({
'placement': 'bottom',
'title': '<a class="passName" href="#">University of Tennessee-Knoxville</a>',
'content': 'Facilities Services Department 2233 Volunteer Boulevard, Room 203 Knoxville, TN 37996-3010',
'html': 'true'
});
此获取内容的代码.passName
不起作用:
$('.passName').click(function(){
console.log($(this).html());
});
难道我做错了什么?还是因为在弹出窗口中所以它不起作用.passName
,我可以做这样的事情来让$('.passName').click(function())
弹出窗口加载后才触发吗?:
$('.UofTennesseeKnox').popover({
'placement': 'bottom',
'title': '<a class="passName" href="#">University of Tennessee-Knoxville</a>',
'content': 'Facilities Services Department 2233 Volunteer Boulevard, Room 203 Knoxville, TN 37996-3010',
'html': 'true'
}, passNamefunction());