<!DOCTYPE html>
<html>
<body>
<h2>My First JavaScript</h2>
<p id="demo"></p>
<script>
function greet(name){
document.write("<br> vishal usrate" + name);
}
// isTimeout = setTimeout(greet,2000,"kale");
// clearTimeout(isTimeout);
// isInterval = setInterval(greet,2000," kale");
// clearInterval(isInterval);
isInterval = setInterval(dateandtime,1000);
// clearInterval(isInterval);
function dateandtime(){
time = new Date();
// document.write(time);
document.getElementById('demo').innerHTML = time;
}
</script>
</body>
</html>
Thanks you for commenting your questions. I will see question and respond you.