Question: Below is an HTML extract page: Name: Age: Person name is: 0 Person is a(n) 0 . // Your code goes here Write a

Below is an HTML extract page: Name: Age: Person name is: 0

 

Below is an HTML extract page: Name: Age: Person name is: 0 Person is a(n) 0 . // Your code goes here Write a function with name "validateAge0" in JavaScript that will take the input of field "age", it will validate it against its numeric value and it will present the results in the "result" div. More specifically, here are the validation rules: If the age is lower than or equal to 15, then the person is a "Teenager". If the age is lower than or equal to 25, then the person is a "Young adult". If the age is lower than or equal to 55, then the person is an "Adult". If the age is more than 55, then person is a "Middle aged". The function should append the name of the person to "name1" span and the age literal to "ageliteral" span. Please note that the "result" div should be visible at the end of the execution.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!