The question is not one year old, but it may be useful for others.
If the content changes only during hiding, the easiest way is to use a function and some JS code.
In particular, my HTML looks like this:
<input id="test" data-toggle="popover" data-placement="bottom" data-trigger="focus" /> <div id="popover-content" style="display: none"> <p>This is the popover content</p> </div>
Please note that the contents of the data are not specified. In JS, when a popover is created, a function is used for the content:
$('test').popover({ html: true, content: function() { return $('#popover-content').html(); } });
And now you can change div-popover-content anywhere, and popover will be updated next time:
$('#popover-content').html("<p>New content</p>");
I assume that this idea will also work using plain text instead of HTML.
Googol Nov 30 '13 at 15:11 2013-11-30 15:11
source share