Skip to main content

HTML DOM lastModified Property in JAVA SCRIPT

Definition and Usage..
The lastModified property returns the date and time the current document was last modified.
Note: This property is read-only.
Syntax: document.lastModified
CODING:
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the date and time this document was last modified.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
    var x = document.lastModified;//new Date(document.lastModified);
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

Comments