Reputation: 21
I am new to web programming. In html web page I want to press a button or anchor tag programmatically.
jquery api has trigger function which triggers call back function attached to a event, but my requirement is to programmatically press a button or link.
Upvotes: 1
Views: 177
Reputation: 5930
Rather than trigger a click on a button or link, the better way to accomplish what you want to do is usually by visiting the link by setting window.location.href
, or by calling the function or submitting the form that the button click would result in.
Upvotes: 1