<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Contact Form</title> <style> .form-group { margin-bottom: 1rem; display: flex; flex-direction: column; } .error-message { color: #d32f2f; font-size: 0.85rem;
Write plain JavaScript with no libraries that validates a contact form. The form has name, email and message fields. On submit, catch empty fields and an invalid email, show the error text right under the field it belongs to, and clear the error once the user fixes the field. If there are no errors, log the form data to the console.
