The problem with his code was that when he was selecting his a with jQuery the result that comes out is an array so you need to specify which item of the array to process. well selecting a single item will always result an array with 1 key and a value which means using  is the solution.
Below is the sample code of clicking on a link using jQuery:
in the code above after selecting the element with id “link” you need to make sure to tell jquery that which one of the items of the selected array you wish to click or process.
Please note in my code I also used function one() which means to do this job only once.