I'm trying to click on time interval select option on the website Costco, since I am building automation, I am selecting each time interval one by one using JS. But I've tried multiple solutions but nothing appears when I click on "Select" element using JS, Iw ould like to know any possible solution that may help me, as Iterating over each time interval and selecting each of the receipt is must requirement for this project. Thank you in advance
bold What I have tried
// Dispatch change event
var simulateMouseEvent = function (
element,
eventName,
coordX,
coordY
) {
element.dispatchEvent(
new MouseEvent(eventName, {
view: window,
bubbles: true,
cancelable: true,
clientX: coordX,
clientY: coordY,
})
);
};
var elementToClick = document.getElementById("Showing");
var box = elementToClick.getBoundingClientRect(),
coordX = box.left + (box.right - box.left) / 2,
coordY = box.top + (box.bottom - box.top) / 2;
simulateMouseEvent(elementToClick, "click", coordX, coordY);
```