Javascript examples for DOM HTML Element:Del
The cite property sets or gets the cite attribute of a <del> element, which sets a URL to a document that explains why the text was deleted.
Set the cite property with the following Values
Value | Description |
---|---|
URL | Sets the source URL to the document that explains why the text was deleted. |
Possible values:
A String, representing the URL of the source document
The following code shows how to return the URL to a document that explains why some text was deleted:
<!DOCTYPE html> <html> <body> <p><del id="myDel" cite="why_deleted.htm">This text has been deleted</del></p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*from w w w.j a va 2s . com*/ var v = document.getElementById("myDel").cite; document.getElementById("demo").innerHTML = v; } </script> </body> </html>