Javascript examples for DOM HTML Element:Quote
The cite property sets or gets the cite attribute of a quotation, which identifies the source URL of a quotation.
Set the cite property with the following Values
Value | Description |
---|---|
URL | Sets the source URL of the quotation. |
A String, representing the URL of the source document
The following code shows how to return the URL of a quotation:
<!DOCTYPE html> <html> <body> <p><q id="myQuote" cite="http://java2s.com">test.</q> </p>//from www . j a va2s .com <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myQuote").cite; document.getElementById("demo").innerHTML = v; } </script> </body> </html>