From c84509951c9a3c3fc21f1a7c4eb6fcf9eee0e121 Mon Sep 17 00:00:00 2001 From: Viktor Svertoka <115661003+ViktorSvertoka@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:27:04 +0200 Subject: [PATCH] Update 11-subscribe.js --- src/js/11-subscribe.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/js/11-subscribe.js b/src/js/11-subscribe.js index 9a94e7d..1ca500c 100644 --- a/src/js/11-subscribe.js +++ b/src/js/11-subscribe.js @@ -6,7 +6,6 @@ import { Messages } from './13-messages.js'; const form = document.getElementById('subscribeForm'); const emailInput = form.querySelector('input[name="email"]'); const subscribeBtn = document.getElementById('subscribeBtn'); -// console.dir(subscribeBtn); emailInput.addEventListener('input', handleEmailValidation); form.addEventListener('submit', subscribe); @@ -20,7 +19,7 @@ function handleEmailValidation() { const emailValue = emailInput.value; const isValid = isValidEmail(emailValue); - // emailInput.style.borderColor = isValid ? 'green' : 'red'; + emailInput.style.borderColor = isValid ? 'green' : 'red'; } async function subscribe(e) { @@ -47,7 +46,7 @@ async function subscribe(e) { ); if (response.status >= 200 && response.status < 300) { form.reset(); - // emailInput.style.borderColor = ''; + emailInput.style.borderColor = ''; return Messages.success(`${response.data.message}`); } else { console.error('Server Error:', response.status, response.statusText);