Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function validateEmail() {
- let emailField = document.getElementById('email');
- let emailValue = document.getElementById('email').value;
- const pattern = /^[a-z]+@[a-z]+\.[a-z]+$/;
- if (!pattern.test(emailValue)) {
- emailField.classList.add('error');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement