Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

HTML Help Please


  • Please log in to reply

#1
dboy

dboy

    New Member

  • Member
  • Pip
  • 1 posts
Hi all,
I just got set a research thing in class, I was wondering how you set the day of the week in HTML so it changes automatically to the day of the week.

Any Help Will Be Great
Thanks
Dboy ^^

Edited by dboy, 07 October 2008 - 07:43 AM.

  • 0

Advertisements


#2
lem.rar

lem.rar

    Member

  • Member
  • PipPip
  • 94 posts
You can't with HTML, you might want to look into JS for a simple solution.
  • 0

#3
lem.rar

lem.rar

    Member

  • Member
  • PipPip
  • 94 posts
Double post, please remove.

Edited by lem.rar, 07 October 2008 - 09:05 AM.

  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Save following to an external js file:

function dayOfWeekImage() {
var dow = new Array('sunday','monday','tuesday','wednesday','thursday','friday','saturday');
var now = new Date;
var dayNow = now.getDay();
var img = dow[dayNow];
document.write('<img src="graphics\/'+img+'.gif" width="200" height="80" alt="'+img+'\'s image" title="'+img+'\'s image">');
}

Put this between the <head> yags of your page:

<script type="text/javascript" src="Js_file_name.js"></script>

Add this to body of your page. Dress up in styled <div> tags if wanted:

<script type="text/javascript">dayOfWeekImage();</script>

Make your images for each day of the week. Set width/height or use same as in code.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP