Open new page and edit its div's via js
Hello, I'm trying to make such a form that you fill in some data, and by submitting the data js will open a new page with the data formatted in a format(template) that I made beforehand. I made a template html that has empty divs that are "waiting" to be filled with the user's data from the form. so far i managed to open the template html file on a new tab, now all left to do is fill in the divs with the user's data from the form. this is my code: // values taken from the form (works well): let store_name = document.getElementById("store-name").value; let store_desc = document.getElementById("store-desc").value; // open new window (work well): let newWindow = window.open('./store_template.html', '_blank'); // load user's data on the template html file (doesn't work!): newWindow.onload = function() { newWindow.document.getElementById("store-name").innerHTML = store_name; newWindow.document.getElementById("store-desc").innerHTML = store_desc; } how can I make it work? thanks.