Social Icons

Pages

How to Display Current Date & Time

<!DOCTYPE html>
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>
Today's date is</h1>
<p id="demo">
</p>

<button type="button" onclick="displayDate()">Display Date</button>

</body>
</html>

No comments:

Post a Comment