JavaScript Print Date and Time #Part 11

 JavaScript Print Date and Time #Part 11



       We make a function that show the current date and time on click button.

HTML and JavaScript Code


    

    

   <button onclick="datefun()">Get Date</button>

<script>

function datefun()

{

var today = new Date();

alert(today);

}

</script>

    

Try it Yourself...

what you think about this article ??

Post a Comment

Previous Post Next Post