Trigger a link's click action with Javascript

Updated . Posted . Visible to the public.

Use the click method on the DOM element:

let link = document.querySelector('a')
link.click()
Profile picture of Henning Koch
Henning Koch
Last edit
Henning Koch
Keywords
jquery
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2013-07-12 16:28)