Skip to content
Related Articles

Related Articles

HTML | DOM lastModified Property
  • Last Updated : 25 Jul, 2019

The DOM lastModified property in HTML is used to return the date and time of the current document that was last modified. This property is read-only. This property returns a string which contains the date and time when the document was last modified.

Syntax:

document.lastModified

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
      DOM lastModified Property
    </title>
</head>
  
<body style="text-align:center">
  
    <h1 style="color:green;">
            GeeksForGeeks
        </h1>
  
    <h2>
            DOM lastModified Property
        </h2>
    <button onclick="geeks()">
        Submit
    </button>
  
    <p id="sudo"></p>
  
    <script>
        /* Function to use lastModified property */
        function geeks() {
            var x = document.lastModified;
            document.getElementById("sudo").innerHTML = x;
        }
    </script>
</body>
  
</html>     

Output:

Supported Browsers: The browser supported by DOM lastModified Property are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :