Skip to content

nerometa/age-calculator-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Age calculator app solution

This is a solution to the Age calculator app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

Screenshot

Links

My process

Built with

  • HTML5
  • CSS3 (Flexbox & Grid)
  • JavaScript

What I learned

Start with our inputs. I use number input for this and it came with arrows. I removed it with this CSS code:

.input-field input {
	appearance: none;
	-moz-appearance: textfield;
}

Then, I ran into another problem: I cannot limit digits for my input. That only works for text. So this is another piece of code I found:

<input oninput="this.value=this.value.slice(0,this.maxLength)" maxlength="2" />

The main gist is the function inside oninput. Essentially, it will receive the value we put in and use slice() to, well, slice any excess digits according to our maxlength value.


I did have a lot to take in when it comes to JavaScript. So, I looked into another person's solution I find in frontendmentor.io. I use most of the code in his script and adjust here and there to my liking. It makes so much sense.

Author

Acknowledgments

About

Age calculator app challenge on Frontend Mentor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published