Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

jquery

click

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

like image 274
PSR Avatar asked Oct 17 '13 08:10

PSR


2 Answers

try:

window.opener.$('.abc').trigger('click') 
like image 198
geevee Avatar answered Sep 30 '22 13:09

geevee


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)
like image 30
Rohan Kumar Avatar answered Sep 30 '22 13:09

Rohan Kumar