I want to attach two HTML and two JavaScript files to each other so that I can access the variables and functions of each other.
I have four files as LogIn.html
, LogIn.js
, signUp.html
and signUp.js
.
I have created the login page using logIn.html
and respective logIn.js
file.
I also created the "Create New Account" page to submit personal information using signUp.html
and respective signUp.js
file.
on logIn.html
, when I clicked "Create New Account" the signUp.html
file gets opened which I stored in the same folder.
Now when the user fills the information in signUp.html
, all the information stored in some variable like firstName
, username
, password
, age
, etc in the signUp.js
file.
Now when the "submit" button is clicked after filling all the information in the signUp.js
file, LogIn.html
file gets opened.
Now I want to use those username
and password
variable in my "username" and "password" field respectively in LogIn.html
file.
Now what I need to do to achieve this or is this never possible?
I could have provided the code but it doesn't make any difference. I hope you get me.
I tried to search the same question on the site but couldn't find the specific answer.