There is a button with the following attributes
<button data-cart-itemid="1be8718a-6993-4036-b7c6-8579e342675d" data-action="inc">
My goal is to determine if the click event occurred on this button specifically, by checking the attribute data-action="inc"
Despite attempting the code below, it consistently returns false
document.addEventListener('click', (e)=>{
console.log(e.target.closest('button').hasAttribute("[data-action='inc']"));
});