Im maintaining a site where I need to ‘click’ a link with javascript. The href is inline javascript, not a url so I cant just navigate to that url instead.
Im expect this is bad practice (the rest of the site is terrible!) but I need to make the link ‘clicked’ with javascript. Im using jQuery.
I know this question has been asked before but it seems normally people are trying to follow the link, which I am not.
The smallest possible way I see, is find link by some finder, like by id, and call click on it:
But better would be to move that inline javascript from link into some function, and leave name of function in href of link, and on page load just call that saved function.