Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Document | Q825 [ previous next ]

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?'

©2018 Martin Webb