案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何访问 QUOTE 元素</h3>
6
7
<p>Here is a quote from WWF's website:</p>
8
9
<p>WWF's goal is to:
10
<q id="myQuote" cite="http://www.wwf.org">
11
Build a future where people live in harmony with nature.</q>
12
We hope they succeed.
13
</p> 
14
15
<p>点击按钮来获得引用的 URL。</p>
16
17
<p id="demo"></p>
18
19
<button onclick="myFunction()">试一下</button>
20
21
<script>
22
function myFunction()
23
{
24
var x = document.getElementById("myQuote").cite;
25
document.getElementById("demo").innerHTML = x;
26
}
27
</script>
28
29
</body>
30
</html>
31