Java script Date Button Code

Date and Time




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

<h1>Date and Time</h1>


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

</body>
</html> 
 }

No comments:

Post a Comment