...

View Full Version : How to change font within a JS script



Rockrz
12-12-2002, 05:18 AM
Anyone have any idea about how I can control the font in the following date script? It now appears as 'New Times Roman' and I'd like for it to be arial like the text on all my pages.

Here's the script:


<!--
// Displays appropriate greeting based on hours of day.
now = new Date();
if (now.getHours() < 12)
document.write("Good Morning, Today is ");
else if (now.getHours() < 17)
document.write("Good Afternoon, Today is ");
else document.write("Good Evening, Today is ");
var today = new Date();
var browser = navigator.appName;
months = new Array( "January","February","March","April","May","June","July","August","September","October","November","December" );
document.writeln( months[ today.getMonth() ] + " " + today.getDate() + ", " + ( (browser != "Netscape" ) ? today.getYear() : today.getYear() + 1900 ) );
//-->

cheesebagpipe
12-12-2002, 06:39 AM
maybe...

<!--
// Displays appropriate greeting based on hours of day.
document.write('<span style="font:200 12px arial;color:brown;">');
now = new Date();
if (now.getHours() < 12)
............
............
today.getYear() : today.getYear() + 1900 ) );
document.write('</span>');

Rockrz
12-12-2002, 04:15 PM
You Da Man!!!

That works perfectly. In fact, it even works in NS4!
Thanks for the tip . . .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum