DateObject-1

 

Example of JavaScript date function: Date() will print the complete date in innerHTML of paragraph tag. See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p id="sample"></p> <script> document.getElementById("sample").innerHTML = Date(); </script> </body> </html>
Output