案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<h3>演示如何访问 DETAILS 元素</h3>
6
7
<details id="myDetails">
8
Some additional details...
9
</details>
10
11
<p>点击按钮来显示额外的细节。</p>
12
13
<button onclick="myFunction()">试一下</button>
14
15
<script>
16
function myFunction()
17
{
18
var x = document.getElementById("myDetails");
19
x.open=true;
20
}
21
</script>
22
23
</body>
24
</html>
25