Wednesday, November 21, 2012

JavaScript and HTML Using to display The Date And Time


Simple Program


<!DOCTYPE html>
<html>
<head>
<script>
function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>

<h1>Simple JavaScript</h1>
<p id="demo">This is a paragraph.</p>

<button type="button" onclick="displayDate()">Display Date</button>

</body>
</html> 

Output :

Simple JavaScript

Wed Nov 21 2012 20:04:16 GMT+0530 (India Standard Time)

0 comments:

Post a Comment

Thanks For Coming The Page.