Javascript DOM HTML Ins Object get

Introduction

The Ins object represents an HTML <ins> element.

We can access an <ins> element via document.getElementById():

var x = document.getElementById("myIns");

Click the button to get the URL of the page that explains why the text has been inserted.

View in separate window

<!DOCTYPE html>
<html>
<body>
<p><ins id="myIns" cite="why_inserted.htm">This is an inserted text.</ins></p>
<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {// www .  ja v  a2 s .  c o m
  var x = document.getElementById("myIns").cite;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related