1👍
This line in your JavaScript:
equalTo: password1,
…needs to be a string:
equalTo: 'password1',
Otherwise JavaScript thinks you are referring to a variable named password1
, instead of specifying the name of the element as string.
Source:stackexchange.com