|In the last lesson we had java script changing the background colour of the document. Not surprisingly, in
this one, we have it changing the text. Try clicking the boxes to see what happens. The
code below still works in modern browsers, but a new page
This is extremely easy because all we do is change the 'b' in bgColor to an 'f'! So the
one line of code (for each colour) is:
And this changes the text in the document to, er, red!
The rest of the code is more or less the same as before with bgColor
replaced with fgColor.
We have done a lot of clicking, so let's take a rest and do on
mouse over code!