Skip to content

Instantly share code, notes, and snippets.

@SmashedFrenzy16
Created April 3, 2022 16:52
Show Gist options
  • Save SmashedFrenzy16/1e63eb0163ec6d41390fc406b0ac87fb to your computer and use it in GitHub Desktop.
Save SmashedFrenzy16/1e63eb0163ec6d41390fc406b0ac87fb to your computer and use it in GitHub Desktop.
A date and time button made in JavaScript embedded into a HTML file.
<!DOCTYPE html>
<html>
<head>
<title> JS Date And Time </title>
</head>
<h1> JS Date And Time </h1>
<body>
<button type="button"
onclick="document.getElementById('dateTime').innerHTML = Date()">
Display Date and Time </button>
<p id="dateTime"></p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment