passing value to parent to popup window using javascript

Example:-

You can use the example to pass the value to parent to popup window

Assign window.open() to a variable so you can access it's elements

In window.open() you give your popup window  url 

<form>
    <input type="textbox" id="txt" />
    <input type="button" id="btn" value="Open window" />
</form>

<script>
document.getElementById('btn').onclick = function(){
    var myWindow = window.open();
    myWindow.document.body.innerHTML = document.getElementById('txt').value;
};
</script>

Comments

Popular Posts