0

Password ValidatoršŸ˜­

Does anyone know what's wrong with this/how to fix it? https://code.sololearn.com/WoS4CoOo4P97/?ref=app

24th Dec 2019, 2:31 AM
Joshua
3 Answers
+ 2
Joshua 1. Please learn to format your code well, it's very distrubing and unprofessional to see bad formatting, not even the if and else have the same identation! 2. In your html file, don't use form, because it will take you to a new page, remove <form> and 3. The method .getElementsByTagName returns an array and not just one element, so if you want to modify only the first element, you must index it, like this: document.getElementsByTageName("p")[0].innerHTML = "What you want"; 4. You didn't get the input text properly, you are getting the element itself, and not the text that it contains. To do so, you must use the getElementById.value: var passwordEntered = document.getElementById("pw").value;
24th Dec 2019, 2:48 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
0
Thanks!
24th Dec 2019, 2:57 AM
Joshua
0
No problem!
24th Dec 2019, 2:58 AM
Aymane Boukrouh
Aymane Boukrouh - avatar