When pressing a button on page1.html I want to open page2.html in new window and copy some data from page1.html to page2.html.
I tried running open_copy() on page1.html
<button id="manual" onclick="open_copy()" type="button" class="btn-primary">copy age</button>
Uncaught TypeError: Cannot set property 'value' of null
I try using local storage, it works but it isn't nice...
function open_copy()
{
var age=document.getElementById('age').value;
var n= window.open('page2.html');
n.focus();
n.document.getElementById('age').value=0.0001;
}
I want to copy age data from page1 to page2.html