PDA

View Full Version : Help with Date and Time.



savage
29 Sep 2009, 06:31 PM
Hi guys,

I have JavaScript code that displays the date, time and URL in the web page, here is the code:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JavaScript Page One</title>
</head>
<body>
<script type="text/javascript">
var today=new Date()
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);


document.write(''+today.toString()+'<br>'+window.location+'')
document.write("<br />");
document.write("Browser name: "+ browser);
document.write("<br />");
document.write("Browser version: "+ version);
</script>
</body>
</html>


How can i format it so that it uses the following colors for different date and time components: Day in red, Date in green, Month in yellow, Year in blue, Hours and Minutes in brown?

And also, what is the JavaScript code to successfully display the number of forms, anchors and links in the page?

Thanks

~Savage