Javascript ile saat ve tarih gösterme nasıl yapılacağını ve setInterval ile nasıl yenileceğini aşağıda açıkladım.


<!-- Bilisimturk.org -->

<html>
<head>
<script language="javascript" type="text/javascript">
function tarihGoster(){
var date=new Date();
document.getElementById("saatgoster").innerHTML="Saat "+date.toLocaleTimeString();

document.getElementById("tarihgoster").innerHTML="Tarih "+date.toLocaleDateString();
}

function yenile(){
setInterval("tarihGoster()",1000);

}

</script>

</head>

<body onload="yenile()">
<div id="saatgoster" style="background-color:yellow">

</div>
<div id="tarihgoster" style="background-color:aqua">

</div>
</body>
</html>




Online Dene


kaynak:http://bilisimturk.org/forum/Javascr...6sterme-konusu