<!DOCTYPE html>
<html>
<head>
<title>Current Date and Time</title>
</head>
<body>
<h1>Current Date and Time</h1>
<p>
The current date and time is: <span id="datetime"></span>
</p>
<script>
var datetimeElement = document.getElementById("datetime");
var now = new Date();
datetimeElement.textContent = now.toString();
</script>
</body>
</html>
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (2)
Maybe try to write some text before the code snippet as well, this way the reader who doesn't have experience knows what the code does 👍
Now with added color styling 😊
You can add litterally only
html
after the tree backticks on the same line like this:Result:
Happy Coding!
thank you so much :)