|
Q821 How can I change the color of text that I write to the document?
irt.org | Knowledge Base | JavaScript | Document | Q821 [ previous next ]
Q821 How can I change the color of text that I write to the document?
Use:
<SCRIPT LANGUAGE="JavaScript"><!--
document.write('<FONT COLOR="black">');
document.write('<P><B>Question.</B> What is black and white and');
document.write('</FONT>');
document.write('<FONT COLOR="red">');
document.write(' red ');
document.write('</FONT>');
document.write('<FONT COLOR="black">');
document.write('all over?');
document.write('</FONT>');
document.write('<FONT COLOR="black">');
document.write('<P><B>Answer.</B> ');
document.write('</FONT>');
document.write('<FONT COLOR="green">');
document.write('A newspaper.');
document.write('</FONT>');
//--></SCRIPT>
|
Also take a look at the article
How long is a piece of string? - Style and Presentation.
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.