Write a simple JavaScript page using functions page that allows the user to enter their age and display an appropriate message. Generate different messages for teenagers (between
13 and 19), working class (20 and 64), retired (65 and above). Add a relevant message that will indicate that the user has made an invalid input.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
What exactly do you need help with?
You can use from a prompt to a input text to get a users age, and then a function to display different messages considering the info the user gave you.
Hint: You can use if/ if else
So... what is it that you are having trouble with, exactly? It seems pretty straightforward to me.