'button is not showing in popover

I am trying to set button in a popover by JavaScript. But button isn't showing.

popStr = "</div> <a href='/shop/checkout'><button class='btn btn-primary' 
id='checkout'>Check out</button></a> <button class='btn btn-primary' onclick='clearCArt()' 
id='clearcart'>Clear cart</button>"
document.querySelector('[data-id="popcart"]').setAttribute('data-bs-content', popStr);
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-id="popcart"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
  return new bootstrap.Popover(popoverTriggerEl,

    {
      html: true
    })
});


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source