Using jQuery trigger for click event on parent win

2019-06-18 04:15发布

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.....

标签: jquery click
2条回答
疯言疯语
2楼-- · 2019-06-18 04:34

try:

window.opener.$('.abc').trigger('click') 
查看更多
神经病院院长
3楼-- · 2019-06-18 04:49

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)
查看更多
登录 后发表回答