I am trying to write Javascript code into the console in chrome that will click a link on a page. The code I am using is
document.getElementById("id_name").getElementsByTagName("a").dispatchEvent(MouseEvent.ClICK)
And gives me this error: TypeError: undefined is not a function
. Am I doing this the right way? And what is the correct way to simulate a click event on an HTML element? Also I am trying to do this without jQuery.