Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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