How to trigger click on a button
Try with this code; it simulates a mouse left click on the element by a quick succession of mousedown, mouseup and click events fired in the center of the button: var simulateMouseEvent = function(element, eventName, coordX, coordY) { element.dispatchEvent(new MouseEvent(eventName, { view: window, bubbles: true, cancelable: true, clientX: coordX, clientY: coordY, button: 0 })); }; … Read more