I created a login form using html and css, i had created a Admin button when i click on the admin button it needs to print the logged in and signup persons details in a table format.
Iam learning java script, html and css. So i created a simple login form and then i created a admin buton.I decided to give a functionality to admin buton.
- When i logged in or signup i need to store that data
2)I need to print the stored data when i clicked on admin button in tabular format.
2
Answers
I’ll preface this by saying this won’t be the cleanest solution, but hopefully the easiest to understand as a beginner.
For the first part of the problem, create a handler function for the signup button on the form which extracts the data from the form fields, creates an object from this data and adds it to an array of users.
For the admin functionality, add an empty table element to your HTML. Then create another handler, for the admin button, which iterates the array of users and creates, as a child of the table element you created, a table row for each of the user objects in the array.
If you have any trouble figuring these out post a code sample and I’ll give you some further pointers 🙂