Question 10
Consider the following JavaScript code.
File name : index.html
<!DOCTYPE html><html>
<body> <form> <label for = "mail"> provide me with an e-mail address: </label> <input type = "email" id="mail" name="mail"> <button>Submit </button> </form> <script src= "script.js">
</script> </body></html>File name: script.js
const email = document.getElementById("mail"); email.addEventListener("input", function (event) { if ((email.validity.typeMismatch)) { email.setCustomValidity("provide me with valid e-mail address!");
}else { email.setCustomValidity("email verified"); } });What will be the output for the given inputs?
1) abcd@gmail.com
2) abcdatgmail
“email verified” and “I am expecting an e-mail address”
“provide me with valid an e-mail address!” and “email verified”
“email verified” and “provide me with valid e-mail address!”
None of these