Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Here I am, is Where I'm at!
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to change font within a JS script

    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 ) );
    //-->
    Adopt a siggy!
    Your Message Here....

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Posts
    596
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>');

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    Here I am, is Where I'm at!
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You Da Man!!!

    That works perfectly. In fact, it even works in NS4!
    Thanks for the tip . . .
    Adopt a siggy!
    Your Message Here....


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •