Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

age-calculator-app

@Gilocah28

Desktop design screenshot for the Age calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Community feedback

P

@KrishnaVishwakarma1595

Posted

Hi, @Gilocah28

Nice solution. Good job. However, I have got a few recommendations that can help you to improve.

  • We can enter the text also. However, you have an error message for this. Instead of input type"text" you should use input type="number". So, your extra step to checking whether the input is text or number will reduce. You can keep it like this -

<input type="number" id="day" min="1" max="31" /> Min and max attribute prevent user to enter a negative value using keyboard's arrow down/up key. And it keeps the input value range between 1-31 for the day field.

  • I noticed when we fill in the input with any value and we focus the input again, it automatically clears the input.

Happy Mentoring

Marked as helpful

1
Sławek 310

@SlawekZet

Posted

Nicely done!

However, you need to work a little bit more on validation, as the calculation is done even if I put 313 days as input and 56 as a month (with month there is no error message displayed).

Either way - good job :)

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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