Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get opener's element with jQuery?

Just like in JavaScript:

opener.document.getElementByName 

jQuery: ??

Is there any way to get opener's element with jQuery?

like image 655
Sungguk Lim Avatar asked Mar 19 '10 07:03

Sungguk Lim


2 Answers

If I understand you correctly, then you simply pass the opener as the second parameter in the jQuery function, like so:

var abc = $("[name=abc]", window.opener.document);

You may also reference the jQuery object directly from the opener, like so:

var abc = window.opener.jQuery("[name=abc]");
like image 79
gpmcadam Avatar answered Nov 09 '22 14:11

gpmcadam


window.opener.$("[name=elementName]")

Replace elementName with the name of your element.

like image 30
Tom Avatar answered Nov 09 '22 13:11

Tom