Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to show current timestamp by single click on page using Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 101
    Comment on it

    Hello Reader's if you want to show the current timestamp on the web page by just a single click, Then by using JS you can do it.

    Lets see the example below:-

    <!DOCTYPE html>
    <html>
    <body>
    
    <h1>My First JavaScript</h1>
    
    <button type="button"
    onclick="document.getElementById('demo').innerHTML = Date()">
    Click me to display Date and Time.</button>
    
    <p id="demo"></p>
    
    </body>
    </html> 
    

    Now as the page will load button will generate and on clicking that it will show the popup with current date and time.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: