stack_alok stack_alok - 2 months ago 7
HTML Question

Trigger an element click on newly opened browser window using Jquery

I have a web page say main.jsp. I am opening a new window using:

which opens second.jsp page in new browser tab.

I am trying to trigger click of an element, with class elementToClick, present on second.jsp using:


However, this is not working.

I am able to do DOM Manipulation like:


but not able to trigger events on it.

Please help me in this. I have read other links related to it but couldn't find a solution to this.


jQuery .trigger('click') will only trigger the click handler associate with the element. It will not actually click the element.

You can use .get() to get the underlying DOM element, then use its click() function