How to update bootstrap popover text?

后端 未结 9 840
长发绾君心
长发绾君心 2020-12-07 20:31

I am using bootstrap-popover to show a message beside an element.

If I want to show different text in the popover after the first time, the text does not change. Re

9条回答
  •  抹茶落季
    2020-12-07 20:42

    You can access the options directly using the jquery data closure dictionary like this:

    $('a#test').data('bs.popover').options.content = 'new content';
    

    This code should work fine even after first initializing the popover.

提交回复
热议问题