|Start | Time | IF | Date Object | Arrays | Avoid the work | Hide email | Random | Intigrate HTML | Test|
The Date Object
Here we deal with time.
This is where we must define a variable.
For now let us just find the year
We use another variable and fill it with the year like so
To print this variable on the page we use document.write like this
Now we have a variable 'yr' that we can play with but first let us put a variable with some regular text into document.write( )
All we do is put a + sign between variables and regular text.
'The year is now '+yr
To review this is how you would print the current year.
Let us figure out our age and print it for all to see.
Make a new variable 'age' and simply subtract your birth year from the current year 'yr'.
(I'll use my own )
Next : Those little adjustments