Design comparison
Solution retrospective
This is my solution for the Newsletter sign-up form with a success message I have used raw HTML, CSS, and Javascript Check out my solution and tell me if there is something that I can improve.
Community feedback
- @MelvinAguilarPosted 12 months ago
Hello there ๐. Good job on completing the challenge !
I have some suggestions about your code that might interest you.
- Regex for email validation should not be limited to "@gmail.com" alone, as there are various email domains. Instead, use a more comprehensive regex pattern to validate emails.
- Separate JavaScript from CSS. Avoid modifying specific styles like borders directly in JavaScript, create a CSS class with the desired styles and use JavaScript to add or remove that class. This helps maintain a cleaner structure and makes it easier to manage styles.
- In your JavaScript code, you can use
textContent
instead ofinnerText
to set the text content of an element.
I hope you find it useful! ๐ Above all, the solution you submitted is great!
Happy coding!
0@Asifp6021Posted 12 months agoHello, @MelvinAguilar thank you for the feedback I appreciate it. you are right there are various email domains. but I only know how to create a basic regular expression. I will learn how to create a regex for various email domains then I will implement it. and I will improve and modify this project as per your suggestion. thank you for taking the time to check this solution and all other solutions. it is really helpful for me as a beginner. and please also give me feedback on HTML and CSS.
1@Asifp6021Posted 12 months agoHello, @MelvinAguilar I improved this project and created a comprehensive regex pattern to validate email. and modified my code as per your suggestion check it out.
1@MelvinAguilarPosted 12 months ago@Asif6021 I consider it excellent; instinctively, I entered my email with a university domain, and that's how I realized.
Very well !
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord