Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q825 Is it possible to write the document title to include the current day and time?

irt.org | Knowledge Base | JavaScript | Document | Q825 [ previous next ]

Q825 Is it possible to write the document title to include the current day and time?

Yes:

<html>

<head>

<script language="JavaScript"><!--
document.write('<title>Date & Time: ' + (new Date()) + '</title>');
//--></script>

</head>

<body>

...

</body>

</html>

Paul Fazio writes:

In Internet Explorer 5.x (I haven't tried it in Internet Explorer 4.x yet) you can use:

document.title = "Your new title";

to place the date and time in the title bar, and even to create a real time clock in the title bar by updating the title every second.

Feedback on 'Q825 Is it possible to write the document title to include the current day and time?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.