Using jQuery trigger for click event on parent window element by class name

冷暖自知 提交于 2019-12-08 16:27:28

问题


I am using

$(".abc",window.opener.document).trigger('click')

To trigger click event on parent window element.

But it is not working.An element exist in the parent window with class name abc.

How i can trigger onclick event ?

Thanks in advance.....


回答1:


try:

window.opener.$('.abc').trigger('click') 



回答2:


Use the context-parameter

$(".abc",parent.document)

But if you really use a popup, you need to access opener instead of parent

$(".abc",opener.document)


来源:https://stackoverflow.com/questions/19421386/using-jquery-trigger-for-click-event-on-parent-window-element-by-class-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!