JQuery click on link not working
Instead of $("#btnSave").click();
try with $("#btnSave").trigger('click');
You can also use $("#btnSave")[0].click();
which is jquery equivalent to document.getElementById("btnSave").click();
Update:
It's not possible to simulate a user link click from javascript, for security reasons, all you can do is attach your own handler for click
event and redirect based on the href
of the link, like so:
$("#btnSave").bind('click', function() {
window.location.href = $(this).attr('href');
});