I want to displaying filled form data using javascript
I m working on single page application concept.
signup.html
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <meta charset="utf-8" />
- <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
- <script src="signup.js"></script>
- </head>
- <body>
- <form id="txtPersonalInformation">
- <h1>Personal Information</h1>
- First Name:<input id="txtfname" type="text" /><br />
- Middle Name:<input id="txtmname" type="text" /><br />
- Last Name:<input id="txtlname" type="text" /><br />
- <input id="btnnext" type="button" value="Next" />
- </form>
- </body>
- </html>
signup.js
-
- $(document).ready(function () {
- $('#btnnext').click(function (event) {
- $("#txtPersonalInformation").load("ContactInformation.html #txtContactInformation");
- });
- });
ContactInformation.html
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- <meta charset="utf-8" />
- <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
- <script src="ContactInformation.js"></script>
- </head>
- <body>
- <form id="txtContactInformation">
- <h1>Contact Information</h1>
- Email Id:<input id="txtemailid" type="text" /><br />
- Password:<input id="txtpass" type="password" /><br />
- Contact No:<input id="txtcontactno" type="number" /><br />
- <input id="btnsubmit" type="button" value="Submit" />
- </form>
- </body>
- </html>
ContactInformation.js
- $(document).ready(function () {
- $('#btnsubmit').click(function (event) {
- debugger
-
- $("#txtContactInformation").load("/signup.html #txtPersonalInformation");
- $("#txtContactInformation").load("/ContactInformation.html #txtContactInformation");
-
- });
- });
when user filled the form data and i want to display there data?