$(document).ready(function () {
$(":button").click(function () {
$(this).next('a').click();
});
});
HTML
<div style="text-align:center">
<input type="button" value="More" class="button">
<a style="display:none" href="/Resource/PhysicianMaterials">aaa</a>
</div>
In this code .click() doesn’t fire for tag, can anyone say what is the problem? Thanks
The
clickevent is firing, however, aclickdoes not go to the URL when you’re talking about an anchor (that happens at the browser/native event level, it’s not JavaScript triggered).Instead you need to do that navigation yourself, like this: