Pass variables between HTML pages using JavaScript
P粉757432491
P粉757432491 2023-08-21 22:08:28
0
2
392

I have two pages - "Page 1" and "Page 2". On page 1 there is a textbox with a value of for example 100, and a button.

After pressing the button, I want JavaScript to save the value of the text box in a global variable and jump to page 2. Using "window.onload", I want the second JavaScript function to pop the saved value on page 1.

This is my JavaScript code: