How would I detect when this button
<button class="btn btn-mobile btn-page-next btn-next-residency" data-name="btn-page-next" type="button">CONTINUE<i class="icon-arrow-thin-right"></i><i class="spinner"></i></button>
Open in new window
is clicked? I tried :
function _dtmCheckContinue(){
document.body.addEventListener('click', function(event) {
if((event.target.dataset)&&(event.target.type == "button")){
if(event.target.dataset.value == "btn-grp-next"){
console.log("<=====> CONTINUE BUTTON CLICKED");
}
}
});
}
Open in new window
I can never get into the if statement on line 4 so obviously there is an issue there.
Thanks!