Search This Blog

Tuesday, March 26, 2013

Display date Java Script

Java Script > Date

<!DOCTYPE html>
<html>
<head>
<script>
    function displayDate() {
        document.getElementById("date").innerHTML = Date();
    }
</script>
</head>
<body>
    <h1>Display date JavaScript</h1>
<p id="date">Click button to display date</p>
<button type="button" onclick="displayDate()">Display Date</button>
</body>
</html>