Javascript DOM HTML del cite Property get

Introduction

Return the URL to a document that explains why some text was deleted:

var x = document.getElementById("myDel").cite;

Click the button to return the value of the cite attribute of the deleted text.

View in separate window

<!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() {//w  w  w . jav a 2s .  c o m
  var x = document.getElementById("myDel").cite;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The cite property sets or gets the cite attribute of a deleted text.

The cite attribute provides a link which explains why the text was deleted.

The cite attribute has no visual effect in web browsers.

The cite property accepts and returns a string value

It specifies the source URL to the document that explains why the text was deleted.

It returns a string representing the URL of the source document.




PreviousNext

Related