JavaScript document lastModified Property Tutorial

In this section, we will learn what the document lastModified property is and how to use it in JavaScript.

How to Check When a Web Page was Last Updated: lastModified Property

The JavaScript document lastModified property is used to check and see when was the last update of an HTML document (the last time that the document was modified in any way).

document lastModified Property Syntax:

document.lastModified;

document lastModified Property Input Value

The property is read-only and so it does not accept a value.

document lastModified Property Return Value

The return value of this property is a string containing the date and time of the last time the document was updated.

Example: alert document lastModified

See the Pen alert document lastModified by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies