stack_alok stack_alok - 1 year ago 82
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download