问题
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