Is it possible to simulate a click on a webpage using javascript but without defining a specific element, but rather just specifying the document?
I would have liked
window.dispatchEvent should do the trick.
Or... with extra MouseEvents information:
The above examples will cause a click to be simulated on window when the button is clicked. An event listener is added to window to alert when clicked, so therefore clicking the button will indirectly trigger an alert.
More info: http://www.howtocreate.co.uk/tutorials/javascript/domevents