I have the html form of the new window and I would like to insert a variable from the main html file c js there, but I can not figure out how to do it. It is necessary that the name that the user entered in the input field appears as text in a new window. Here is my code, please help.
The main function script:
<script> function hello_Programm() { var name = document.getElementById('name').value; var new_window = window.open("form.html", "hello", "width=500,height=500"); return name; } </script> HTML main page:
<body> <center><p class="h1">Welcome!</p></center> <hr> <input class="text_form" type="text" placeholder="Mary Jane" id="name"> <input type="button" value="Hello!" onClick="hello_Programm()"> </body> HTML and JS new window
<body> <center><p><script>//здесь должна быть переменная с именем пользователя</script></p></center> <hr> <p>Take this bouquet as a gift:</p> <img src="rose.png"> </body>