Created
          August 13, 2020 04:25 
        
      - 
      
 - 
        
Save kartset/fd084b27d88d0a17637a6beed93ec5d4 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Declare a Function</title> | |
| </head> | |
| <body> | |
| <h1>Declare a function</h1> | |
| <div> | |
| <h2>Today's Date</h2> | |
| <span id="calender"></span> | |
| <input type="button" id="myButton" value="Get Date" onclick="showDate()"> | |
| </div> | |
| <script> | |
| //Declare your function | |
| function showDate() { | |
| var today = new Date(); | |
| var myCalender = document.getElementById("calender"); | |
| var myButton = document.getElementById("myButton"); | |
| myCalender.innerHTML = today.toDateString(); | |
| myButton.value = "Well Done !"; | |
| } | |
| </script> | |
| </body> | |
| </html> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment