Javascript DOM HTML Document lastModified Property get

Introduction

Get the date and time the current document was last modified:

var x = document.lastModified;

Click the button to display the date and time this document was last modified.

View in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {/*from  w w w. j  a  va2s. co  m*/
  var x = document.lastModified;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The lastModified property returns the date and time the current document was last modified.

This property is read-only.




PreviousNext

Related