HTML DOM Document lastModified attribute
- Forrige side inputEncoding
- Næste side links
- Gå tilbage til forrige niveau HTML DOM Documents
Definition and usage
lastModified
The property returns the date and time of the last modification of the document.
lastModified
The property is read-only.
hint
"try it yourself" example always returns the current date/time because the document is created at runtime.
example
Example 1
Get the date and time of the last modification of the document:
let text = document.lastModified;
Example 2
Convert the lastModified attribute to a date object:
const date = new Date(document.lastModified);
syntax
document.lastModified
return value
type | description |
---|---|
string | date and time of the last modification of the document. |
browser support
document.lastModified
er en DOM Level 3 (2004) funktion.
Alle browsere understøtter det:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
- Forrige side inputEncoding
- Næste side links
- Gå tilbage til forrige niveau HTML DOM Documents