Mac Taylor
Mac Taylor

Reputation: 5168

window opener manipulation; Add a text to a element in parent window

I have a pop up window which user can select files and then it will alert the selected image's URL. But I need to do more than that.

I am looking for a way to insert the URL to the parent window's input element.

window.opener.document.write(url);

This will overwrite the parent window's content. But I need to add the URL to special input element in parent window.

I was just thinking what if this literally works !

window.opener.document.getElementById("image").write(url);

Thanks in advance.

Upvotes: 1

Views: 1358

Answers (1)

Andreas
Andreas

Reputation: 21911

window.opener.document.getElementById("image").value = url;

Upvotes: 6

Related Questions