案例:javascript案例     状态:可编辑再运行    进入横版
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何创建 BLOCKQUOTE 元素</h3>
6
7
<p>请点击按钮来创建 BLOCKQUOTE 元素,此引用的来源是 worldwildlife.org。</p>
8
9
<button onclick="myFunction()">试一下</button>
10
11
<script>
12
function myFunction()
13
{
14
var x = document.createElement("BLOCKQUOTE");
15
var t = document.createTextNode("For 50 years, WWF has been protecting the future of nature.");
16
x.setAttribute("cite", "http://www.worldwildlife.org/who/index.html");
17
x.appendChild(t);
18
document.body.appendChild(x);
19
}
20
</script>
21
22
</body>
23
</html>
24

 运行结果 
 北美留学生论坛