CodePudding user response:
In your, if statement you're assigning the value to the password field instead of comparing it. Check how to use the comparison operators. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness