JavaScript explained

JavaScript is used for things like "roll over buttons", "drop down menus" etc. where something changes on the page when it is clicked or rolled over.

It has a problem where it is activated by the browser and is not supported to the same extent in every browser and some users turn JavaScript off for security reasons.

Digital Clock created with JavaScript

Code to create this clock :-
<form name="time">
<input type="text" name="time2" size=15 />
</form>

<script type="text/javascript">

function liveclock(){
var curdate=new Date()
var hours=curdate.getHours()
var minutes=curdate.getMinutes()
var seconds=curdate.getSeconds()
var suffix="AM"

if (hours>=12){ suffix="PM"
if (hours>=13)hours-=12 }

if (minutes<10)
minutes="0"+minutes
if (seconds<10)
seconds="0"+seconds
var thetime=hours+":"+minutes+":"+seconds+" "+suffix
document.time.time2.value=thetime
setTimeout("liveclock()",1000)
}

liveclock()

</script>