22 AnswersNew Answer
Your code expects a DOM element with "not" as id. You didn't provide it in your HTML. Add this in body: <div id="not"></div> Also remember that script from JS tag of CodePlayground are part of HTML head tag. https://www.sololearn.com/post/90825/?ref=app
Fixed : https://code.sololearn.com/WL14fO4a5Ysg/?ref=app
I want it to do something like this, Please can you tell me why it is only iterating through the last one and why it is returning an error. https://code.sololearn.com/W0huh4GrhBS0/#js
Emebo Prosper I am not getting what you want to make. Do you want to store the usernames and passwords in the array?
Okay let, me clear things up : 1) User will enter a username 2) The programe will generate a password using the first and last name of the username. 3) Then you want to show the username and password on the screen. Is that so?
Not really let me give you an over view (1) new user creates account (2) Application stores it in local storage as an array inside an array called accounts (3) User logs in with user name, application fetches name from the dom and compares it with the one in the account array then adds it in local storage called current account. (3)When the user generates password he saves the password with a name.
(4) Then the application stores it as an array identifying the current then compares it with the one in local storage and stores as an array in local storage
(5) The question i asked is about the dashboard i want it to get the password from local storage based on the user name in the account array that is in the local storage
Thanks Arb Rahimb Badsa and kevin star i found the solution
Emebo Prosper This should solve your issue :)) You can check it even though you've solved. https://code.sololearn.com/W7Um4Avx19Fm/?ref=app
Thank you boss for everything you made my complicated code easy
That window.onload is the same thing as <body onload="myFunction()"></body> right
I sorry im coding on my computer so when i was pasting i forgot
I have modified that but it's still not working
Please i don't understand. But as far as i know in the execution stack all functions are called first
And on my computer the loop is only iterating once which is the last one, why??
The first name and last name is what will be used to recognise the passwords of the user
So in that particular function the first name and last name is not needed that is why i removed it