ins cite Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Ins

Description

The cite property sets or gets the cite attribute of an inserted text, which identifies a URL to a document that explains the reason why the text was inserted.

Set the cite property with the following Values

Value Description
URL Sets the source URL to the document that explains why the text was inserted.

Return Value

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 inserted:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p>This is a text.
<ins id="myIns" cite="http://java2s.com">This is an inserted text.</ins>
</p>/*from   www.ja v  a2  s  .c om*/

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

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

<script>
function myFunction() {
    var  v = document.getElementById("myIns").cite;
    document.getElementById("demo").innerHTML = v;
}
</script>

</body>
</html>

Related Tutorials