JAVASCRIPT help please! Simple script

Anyone has a solution for this on Edit plus?

Using HTML and JavaScript, design and code a program which prompts a user for the year they were born, calculates the user’s age and displays the user’s age. If the user’s age is over 40 then set the background color of the web page to red. The solution must use the JavaScript Date object and use programmer created functions for calculating the user’s age.

Pay attention in class/read your book?

why waste your time and reply? When did forums become so unfriendly. seirously

Hi oVanessao, welcome to the forums,

Perhaps not so “Simple script”?

What have you got so far? I usually write a type of outline of what needs to be done so I can get an idea of the logic I’ll need to use. eg.

prompt user for the year they were born
calculate the user’s age
display the user’s age
If the user’s age is over 40 then set the background color of the web page to red
*use the JavaScript Date object
*functions for calculating the user’s age.

The prompt is easy, you can find that by searching “javascript prompt”

Then search for “javascript date object”

Then search for “javascript background property”

After you research those you should be pretty well set if not completely done.

Mitti im trying that. Thank you so far!

did you try searching in Google, you should be able to find lot of examples written in javascript similar to what you trying to do, here is one

http://javascript.internet.com/math-related/age-calculator.html