Monday, June 27, 2016

Date in Javascript

Here is the example code :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<!DOCTYPE html>
<html>
<body>

<h1>My First JavaScript</h1>

<button type="button"
onclick="document.getElementById('demo').innerHTML = Date()">
Display Date</button>

<p id="demo"></p>

</body>
</html>

Result :


No comments:

Post a Comment