HTML Help Please, Changing Day Of Week In HTML |
![]() ![]() |
HTML Help Please, Changing Day Of Week In HTML |
Oct 7 2008, 07:40 AM
Post
#1
|
|
|
New Member ![]() Posts: 1 OS: XP |
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 ^^ This post has been edited by dboy: Oct 7 2008, 07:43 AM |
|
|
Oct 7 2008, 09:04 AM
Post
#2
|
|
|
Member ![]() ![]() Posts: 93 OS: Windows XP Pro, Windows Server 2003 |
You can't with HTML, you might want to look into JS for a simple solution.
|
|
|
Oct 7 2008, 09:05 AM
Post
#3
|
|
|
Member ![]() ![]() Posts: 93 OS: Windows XP Pro, Windows Server 2003 |
Double post, please remove.
This post has been edited by lem.rar: Oct 7 2008, 09:05 AM |
|
|
Oct 7 2008, 03:07 PM
Post
#4
|
|
![]() Trusted Techie Posts: 4,476 From: FEMA took "Tin Can" away! OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem! |
Save following to an external js file:
CODE 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: CODE <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: CODE <script type="text/javascript">dayOfWeekImage();</script> Make your images for each day of the week. Set width/height or use same as in code. |
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
2 / 276 | 22nd June 2005 - 02:59 PM LuckyCharms started - last by greyknight17 |
|||||
![]() |
6 / 320 | 14th July 2005 - 11:06 AM lilbashi187 started - last by Trevuren |
|||||
![]() |
3 / 492 | 29th November 2005 - 08:12 PM JoKeR started - last by JoKeR |
|||||
![]() |
4 / 579 | 20th February 2006 - 10:24 PM nighter started - last by loophole |
|||||
|
Time is now: 2nd December 2008 - 04:11 PM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |