Capturing Place Order Button Click

I am trying to capture the “Place Order” button click event, which is contained within the checkout page constructed by WineDirect (Settings > Website Editor > Checkout Design).

So far, I have been able to fetch the actual button with this script block injected into the page by enabling Enabled Advanced HTML Header and adding the snippet into the HTML Output block.

However, my logEvent function never triggers, because I never see the message “===== USER CLICKED TOP PLACE ORDER BUTTON =====” logged to my console. Is there a way for me to add an onclick event to this button?

<script type="text/javascript">
// Top Place Order Button
document.addEventListener('DOMContentLoaded', (e) => {
  var checkPlaceOrderButtonExists = setInterval(function() {
    const topPlaceOrderButtonElements = document.getElementsByClassName('v65-topPlaceOrderButton');
    if (topPlaceOrderButtonElements && topPlaceOrderButtonElements[0]) {
      const button = topPlaceOrderButtonElements[0].getElementsByTagName('button')[0];
      console.log("===== Found top place order button!!!!! =====");
      console.log(button);
      originalClickAttribute = button.getAttribute("v65js-click");
      console.log("===== OriginalClickAttribute =====");
      console.log(originalClickAttribute);
      
      button.addEventListener('click', function logEvent(e) {
        console.log("===== USER CLICKED TOP PLACE ORDER BUTTON =====");
      }, false);
     
      clearInterval(checkPlaceOrderButtonExists);
    }
   }, 100);
});                                               
</script>