案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何访问 Ins 元素</h3>
6
7
<p><ins id="myIns" cite="why_inserted.htm">这是一段插入的文本。</ins></p>
8
9
<p>点击按钮来获得页面的 URL,该页面解释了文本被删除的原因。</p>
10
11
<p id="demo"></p>
12
13
<button onclick="myFunction()">试一下</button>
14
15
<script>
16
function myFunction()
17
{
18
var x = document.getElementById("myIns").cite;
19
document.getElementById("demo").innerHTML = x;
20
}
21
</script>
22
23
</body>
24
</html>
25