I've been having a little trouble with a page I'm making. I've managed to create eight buttons that change the background colour without any bother, but when it comes to changing the text on the page, the document wont change the colour of the text. I'm really new to the language, so I've tried things that will probably seem laughable to you all (such as the following code, where 'textform' is a form and 'txcolour' is a text input in the body section:
obj2 = document.textform.txcolour;
if ((obj2.value.substring(0,1) != '#') ||
(obj2.value.length != 7))
alert("Please use a correct hexadecimal code or one of the buttons provided to fill this input");
document.color = obj2.value;
..note the document.color at the end, which for some bizarre reason I thought might change the colour of the text on the page.
The function works (or should work) by having a value placed in a text box, and then hitting a second button which takes the value in the textbox as the background colour, as you can see in the code fragment. However, while document.bgColor works easily enough on the background, nothing I do can change the colour of the text. I even tried containing the text I wanted to change the colour of inside a <textarea>, which had equally pathetic results - about all I managed to do was alter the colour of the text when it first appears.
Can anyone help?