<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Type something without '@' and click submit.</p>
<form action="/email.php" method="get">
<input type="email" name="myEmail" required>
<input type="submit" value="Submit">
</form>
<script>
var x = document.getElementsByTagName("input")[0];
function myFunction(){
alert("Invalid Email Address");
}
x.addEventListener("invalid", myFunction);
</script> </body>
</html>