in this article, I will show you how to display running date and time in jquery
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
function time_set(){
var refresh=1000;
setTimeout('time_get()',refresh)
}
function time_get() {
var time_val = new Date()
$("#curtime").html(time_val);
time_set();
}
</script>
<script>
$(document).ready(function() {
time_get();
});
</script>
</head>
<span id="curtime"></span>
</html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
function time_set(){
var refresh=1000;
setTimeout('time_get()',refresh)
}
function time_get() {
var time_val = new Date()
$("#curtime").html(time_val);
time_set();
}
</script>
<script>
$(document).ready(function() {
time_get();
});
</script>
</head>
<span id="curtime"></span>
</html>
0 Comments
if you have any doubts , please let me know