You need to make the markup right
<button type="button" id="example" class="btn btn-primary">example</button>
Then, one way is to attach the close-handler inside the element itself, the following works :
$(document).ready(function() {
$("#example").popover({
placement: 'bottom',
html: 'true',
title : '<span class="text-info"><strong>title</strong></span>'+
'<button type="button" id="close" class="close" onclick="$("#example").popover("hide");">×</button>',
content : 'test'
});
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…