I would like help with this question. If email1 and email2 (Strings) are equal when submit is pressed, an alert message box will be displayed. I didn’t add an else statement.
Error:
Uncaught ReferenceError ReferenceError: email1 is not defined
at (script.js:7:17)
function equals_function(email1, email2) {
if (email1 != email2) {
alert("You didn't enter matching email addresses in the input!") // output alter
}
}
equals_function(email1, email2)
<form>
<label for="email1">Email Address:</label>
<input type="text" name="emailone" id="emailone">
<p>
<label for="email2">Email Address Confirmation:</label>
<input type="text" name="emailtwo" id="emailtwo">
</p>
<p><input type="submit"></p>
</form>