Click to See Complete Forum and Search --> : changing the font color and face of an auto time javascript


sgroove
10-21-2003, 08:00 AM
would neone know if it is possible to change the font color and face of an automatic time javascript display?

Jona
10-21-2003, 07:01 PM
Could you explain what you mean by "automatic time javascript display"?

[J]ona

sgroove
10-22-2003, 01:30 AM
just say the automatic time display was like this:

21 October 2003 (in Arial font and in black)

Would you be able to change the text to like another font and a different color taking in consideration that the date is auto. javascript...?

Charles
10-22-2003, 04:58 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>

<style type="text/css">
<!--
#time {background-color:#000; color:#f00;font-family:Arial; font-weight:bold; padding:1ex}
-->
</style>

<script type="text/javascript">
<!--
document.write('<p id="time">', new Date().toLocaleString(), '</p>');
if (document.getElementById) setInterval("document.getElementById('time').firstChild.data = new Date().toLocaleString()", 25);
// -->
</script>