<script> document.addEventListener('DOMContentLoaded', function() { const emailField = document.getElementById('contact-form__email'); const emailInput = emailField.querySelectorAll('input')[0]; if (emailInput) { console.log('Dodano event listener'); emailInput.addEventListener('input', function () { console.log('Wywołano Event Listener "Input"'); const email = emailInput.value; if (isValidEmail(email)) { console.log('Email poprawny'); emailInput.classList.remove('contact-form__email--incorrect'); } else { console.log('Email niepoprawny'); emailInput.classList.add('contact-form__email--incorrect'); } }); } function isValidEmail(email) { const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; return emailRegex.test(email); } }) </script>