'Date' Example : Date « Javascript Objects « JavaScript Reference

'Date' Example

    
<html>
<body>
<script language="javascript">
function myFunction(){
    var date = new Date(); 
    alert(date.toString());
}
</script>
<button onclick="myFunction();">Today's date</button>
</body>
</html>

    
      
      








Related examples in the same category

1.'Date' Syntax and Note
2.'Date' JavaScript Properties
3.'Date' JavaScript Methods