Last active
April 16, 2024 15:56
-
-
Save jadiagaurang/4cd13032d5dec53c80cd9ac7da2e3270 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find all Send to Card Buttons | |
let arrayElements = document.querySelectorAll(".coupon-action.button-blue.sc-send-to-card-action"); | |
// Declare a Looping Function to Delay Click Event! | |
function loopThroughNodes(arrayElements) { | |
let intDelay = 2000; // 2 Seconds Timeout to | |
for (var i = 0; i < arrayElements.length; i++) { | |
(function (i) { | |
let timeoutID = window.setTimeout(function () { | |
//console.log(arrayElements[i]); | |
// Scroll the element | |
arrayElements[i].scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" }); | |
// Trigger Native Click Event Handler | |
arrayElements[i].click(); | |
}, intDelay * i); | |
//console.log(timeoutID); | |
})(i); | |
}; | |
} | |
// Start the Engines! | |
loopThroughNodes(arrayElements); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note they changed
button-red
tobutton-blue