validateEmail function creates
input instance and set the
value=[email address to validate]. Next, we use
input.checkValidity() function to check if given email address is correct.
input.checkValidity() function available in modern browsers.