Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q821 How can I change the color of text that I write to the document?

You are here: irt.org | FAQ | JavaScript | Document | Q821 [ previous next ]

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.

©2018 Martin Webb