Javascript examples for DOM HTML Element:Ins
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. |
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:
<!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>