Design comparison
Solution retrospective
What are you most proud of, and what would you do differently next time?
In this challenge, I came across some really insightful discoveries:
- Pseudo-elements and input elements: I learned that when working with input elements, you cannot directly apply the
::before
and::after
pseudo-elements to them. These pseudo-elements are meant to add content before or after an element, but they don't work the same way with `` fields. This was a new finding for me, as I had previously used these pseudo-elements on other HTML elements without issue. Recognizing this limitation for input fields is an important piece of knowledge that will help me avoid confusion and unexpected behavior in the future. - Email validation with JavaScript: The second thing I learned was related to the email validation function I implemented using JavaScript. I created a function that used a regular expression to check the validity of an email address. However, I initially got stuck on the logic of the
if
statement, as I had the condition reversed. I had writtenif (emailIsValid)
when I should have hadif (!emailIsValid)
. This meant that the function was returningtrue
if the email was invalid, andfalse
if the email was valid - the opposite of what I intended. After spending some time troubleshooting, I realized my mistake and corrected the logic. This experience has reinforced the importance of carefully testing and validating my code, especially for critical functionality like email validation.
What specific areas of your project would you like help with?
Any feedback is appreciated
Community feedback
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