I have a link tag that doesn't contain a url, but instead it has javascript. I'm using jQuery and when I try the ".click()" function, it doesn't work. I searched through the website and found some answers but all of them open the "href" of the link tag and these answers won't be helpful in my case, here's an example of the code :
<button onclick="ClickMe();">CLick Me!</button>
<a id="test" href="javascript:alert('hi');">Alert</a>
<script>
function ClickMe() {
$("#test").click();
}
</script>
This is a shared project and my ability to change the html of the page is very limited.
Here's the example : http://jsfiddle.net/Ayman_Mohamed/ygDmW/1/