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

Thread: Date js script

  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Date js script

    Hello to all,

    I am a network manager in the UK, I have very little experience with websites, and have only started to dabble in the last few weeks. It has been a long time since my education, even though we covered a little javascript, I have forgotten pretty much all I learnt about it. I've had lots of anger spouts creating this site - from college, I remembered thinking 'to make a decent site, I need to use frames and nice attractive flash buttons...' Well, I met with a friend a week or so ago who designs websites for a living, and she said, 'You're doing 2 things wrong, 1, you're using frames 2, you're using flash buttons!' With that I started again using a wild assortment of tables, and I must say, i am most pleased with the site so far!

    Any way, to the point. I am trying to use the; 'document.write(Date())' command, but I dont remember how to edit the text generated by this command. I would like it to appear white, and size 12 font. This is how it's appearing in my html;

    Code:
    <td width="220"><p>
            <script type="text/javascript">
    
    document.write(Date())
    
          </script>
              </p></td>
    The time/date is appearing exactly where I want it to in my table, as i mentioned, I just want to change the size and font, as it is appearing in the default black times new roman format. Is there some code that I can add to this to change it, or is this a big requirement that I'm looking for? I apologise if i have been vague here, I lack confidence with scripting and i dont really know what i'm talking about!

    Regards,

    Rob

  • #2
    Banned
    Join Date
    Oct 2005
    Location
    I'm in GMT -5
    Posts
    314
    Thanks
    0
    Thanked 1 Time in 1 Post
    Rob:
    Include a style string:
    Code:
    <td width="220"><p style="font-family:tahoma;font-size:14pt;color:#add8e6;background-color:#90ee90">
            <script type="text/javascript">
    
    document.write(Date())
    
          </script>
              </p></td>

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Aha, simple as that. You are an absolute star, thank you very much


  •  

    Posting Permissions

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