Javascript DOM HTML del cite Property set

Introduction

Change the value of the cite attribute:

document.getElementById("myDel").cite = "http://www.example.com/whywedeletedsometext.htm";

Click button to change 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  ww  .ja  v a 2 s  .co m
  document.getElementById("myDel").cite = "http://www.example.com/whywedeletedsometext";
  document.getElementById("demo").innerHTML = "The value of the cite attribute was changed.";
}
</script>

</body>
</html>



PreviousNext

Related