There is the first page, on it there are two input fields and the "Enter" button, how can you go to another page by pressing the button and transfer the lines from the fields to its JavaScript?
1 answer
Well, if these two fields are not a login and password, then you can pass directly through the address bar, for example, here page1.html:
<form action="page2.html" method="get"> <input name="value1"> <input name="value2"> <button type="submit"></button> </form> Code for page2.html page:
const urlParams = new URLSearchParams(window.location.search); const value1 = urlParams.get('value1'); const value2 = urlParams.get('value2'); - And if the username and password? - Kirill Nikiforov
- To think about the server part - Vitaly Shebanits September
- @ KirillNikiforov can not be transmitted in open form. The question is why transfer the login and password using javascript and html? - Egor Genning
|
localstorageand also count on another page by itself - Tsyklop