I'm comparing password in javascript and someone its not working its working on my past project before here is the HTML
<form>
<label>
<strong>Username</strong>
<input type="text" name="">
</label>
<label>
<strong>Password</strong>
<input type="password" name="" id="password">
</label>
<label>
<strong>Confirm Password</strong>
<input type="password" name="" id="confirmpassword">
</label>
<button class="button" type="submit" id="button" onclick="click();">Submit</button>
</form>
and here is javascript
function click (){
var password = document.getElementID('password').value,
confirmpassword = document.getElementID('confirmpassword').value
if (password == ""){
alert("Field cannot be empty.");
}
else if (password != confirmpassword){
alert("Password didnt match try again.");
return false
}
else if(password == confirmpassword){
alert("Password Match")
}
return false
}