I have here a popover with a dynamic content which shows up when I click the popover button. I want to close it when I also click on another area of the page. However, the popover only closes when I click the popover button.
<a class="btn btn-danger" id="btn-post" data-html="true" data-placement="bottom" data-original-title="Post/Lock">
Post/Lock
</a>
I do not set the data-content
on my HTML code. I set it on the js
$("#btn-post").click(function() {
$("#btn-post").attr("data-content", var_dynamic_content);
$('#btn-post').popover('show');
});
I have tried following some codes answered in this post
How to dismiss a Twitter Bootstrap popover by clicking outside?
but nothing there seemed to work for me.