I know the following function to trigger click:
var link = $("#linkId");
link.click();
but in my case I don`t have id, but I have name attribute, so I used:
var link = $('a[name=content_'+params['p']+']');
link.click();
But it is not clicking, what is the problem with the code above. if I use id it works fine.
'a[name=content_'+params['p']+']'refers to an existing element. Also, calling.clickwill only execute the event handlers, it will not make the browser follow that link..click()specifically onaelements. jsfiddle.net/HB6X5/5 :P It does call it on other types of element (the native .click() method) if the default action wasn't prevented and the target element has the native method.