I have a popup window that I need to access click, change or any other event as well as elements values for input and move them to parent window element
example popup window html:
<a href="#" class="button">Add image</a>
<input type="text" id="imagelink" value="link_to_image" />
parent window html:
<img id="logo_image" src="default_image_link" />
start js:
window.addEvent('domready', function(){
$$('.button').addEvent('click', function(){
var img_src = $('imagelink').get('value');
$('logo_image').set('src',img_src);
});
});
when user clicks on a.button in child window , I need to replace src property of parent window #logo_image with value from input #imagelink
You can do it by accessing
window.opener
property of popup window which points to parent window:Or if you also have MooTools in parent window: