Very Simple Question, help appreciated, anyone?
Posted: Mon May 18, 2009 3:57 pm
Hey guys I have the following date script which prints the current date. Is there any way to use document.getElementById to make this script print on a selected div? I tried deleting document write and writing document.getElementById("date")= and that did not work.
Code: Select all
<script language="Javascript">
<!--
var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
var monName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
var now = new Date
document.write("Today is " + dayName[now.getDay()] + ", " + monName[now.getMonth()] + " "+now.getDate() +" "+ now.getYear()+".")
//-->
</script>