I have watched many tutorials on how to solve this problem and even trying to log it into the console. However since I am quite new to this part of coding I feel like I have made a mistake, could someone please identify so I understand?
I tried using the <.value> but it didn’t seem to exist on VScode which was very odd.
here is my code:
const email = document.getElementById('emailId');
const password = document.getElementById('passwordId');
const repassword = document.getElementById('passwordreconfirmId');
let evalue = email.setAttribute(value,);
let pvalue = password.setAttribute(value,);
let rpvalue = repassword.setAttribute(value,);
function popup() {
if (evalue, pvalue, rpvalue === 4) {
document.getElementById('nextButton').removeAttribute('disabled', 'disabled');
} else {
document.getElementById('nextButton').setAttribute('disabled', 'disabled');
}
}
<div class="Password-Text">
<input type="password" onload="passwordvalue" class="pswd" id="passwordId">
</div>
<div class="Password-Text-Reconfirm">
<input type="password" onload="repasswordvalue" class="re-pswd" id="passwordreconfirmId">
</div>
<div class="next_page">
<button disabled="disabled" onload="popup()" type="submit" id="nextButton">
<style>
</style>
</button>
</div>
2
Answers
Are you looking for something like this?
evalue, pvalue, rpvalue === 4
. NOTE, a field value is a string, so "4", not 4password.getAttribute('value')
for example but you can just use password.valueHere is a working version