How to Create a “PUSH ME” Button that Displays YOUR Current Date & Time

How to Create a “PUSH ME” Button that Displays YOUR Current Date & Time

It’s cool what you can learn just by using your computer’s developer tools and searching through someone’s website.

Copy and paste this:

<script type=”text/javascript” charset=”utf-8″>
function showdate(){document.getElementById(“date-press”).innerHTML=Date();}
</script>
<div style=”text-align:center; margin: 20px auto; width: 500px; background: #f9f9f9; padding: 10px;” id=”date-press-button”>
<button type=”button” style=”margin:auto auto” onclick=”showdate()”>PUSH ME!</button>
<div id=”date-press” style=”color: #ff3333; text-align: center; font-size: 20px”></div>
</div>

Now you can conquer the world.

Leave a Reply

Your email address will not be published. Required fields are marked *