Page 1 of 1

Displaying the date and time

Posted: Tue Feb 21, 2017 5:56 pm
by codeflavour
Simple, but useful. Give it a go.

Code: Select all

<!DOCTYPE html>
<html>
<body>

<h1>Date & Time</h1>

<button type="button"
onclick="document.getElementById('example').innerHTML = Date()">
Click me to display Date and Time.</button>

<p id="example"></p>

</body>
</html>

Re: Displaying the date and time

Posted: Tue Feb 21, 2017 11:39 pm
by codeflavour
We'd like to see examples of this feature in use if you have any. Just comment below. Thanks!