To click on a link programmatically in the javascript you can just use an

To get the element use document.getElementByID('id').

Please refer to the following code pen for an example of how to programmatically perform the click operation on any element.

  <head> </head>
    <a href="" id="link"> 
        This is an achor element and being pointed to 
    <script> document.getElementById('link').click(); </script>