Javascript examples for DOM HTML Element:Del
The dateTime property sets or gets the datetime attribute of a <del> text, which identifies the date and time when the text was deleted.
Set the dateTime property with the following Values
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD | The date and time of when the text was deleted. |
A String, representing the date and time of when the text was deleted
The following code shows how to return the date and time of when some text was deleted:
<!DOCTYPE html> <html> <body> <p><del id="myDel" datetime="2011-11-15T22:55:03Z">This text has been deleted</del></p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w w w . j av a 2s. co m*/ var v = document.getElementById("myDel").dateTime; document.getElementById("demo").innerHTML = v; } </script> </body> </html>