Javascript DOM HTML ins cite Property set

Introduction

Change the value of the cite attribute:

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

Click the button to change the value of the cite attribute of the inserted text.

View in separate window

<!DOCTYPE html>
<html>
<body>

<p>This is a text.
<ins id="myIns" cite="why_inserted.htm">This is an inserted text.</ins>
</p>//ww  w  .j  a va2 s .c  o m
<p id="demo"></p>

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {
  document.getElementById("myIns").cite = "http://www.example.com/whyweinsertedsometext.htm";
  document.getElementById("demo").innerHTML = "The value of the cite attribute was changed.";
}
</script>

</body>
</html>



PreviousNext

Related