Get Quote Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Quote

Introduction

The Quote object represents an HTML <q> element.

You can access a <q> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<q id="myQuote" cite="http://www.java2s.com">quote text</q>

<button onclick="myFunction()">get the URL of the quotation</button>

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

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

</body>
</html>

Related Tutorials