<html>
<body>
<p>Click the button to execute the <em>displayDate()</em> function.</p>
<button onclick="displayDate()">Try it</button>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
<p id="demo"></p>
</body></html>