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. The code for both labels is included. Thanks!
The equals_function at the bottom is incorrect with the quotes. I had equals_function(email1, email2)
but had no luck, was getting an error in Visual Studio code. Please help with this code.
...
<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>
<input type="submit">
...
</form>
Please, and the javascript
function equals_function(email1, email2) {
if (email1 != email2 ) {
alert("You didn't enter matching email addresses in the input!") // output alter
}
}
equals_function("[email protected]", "[email protected]")