发布网友 发布时间:2022-04-22 08:20
共1个回答
热心网友 时间:2022-04-19 23:27
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RunJS 演示代码</title>
<script>
var toggle = function(btn){
details.open = details.open ? false : true;
btn.innerHTML = details.open ? "close" : "open";
}
</script>
</head>
<body>
<button onclick="toggle(this)">
open
</button>
<details id="details">
<summary>Google Nexus 6</summary>
<p>商品详情:</p>
<dl>
<dt>屏幕</dt>
<dd>5.96” 2560x1440 QHD AMOLED display (493 ppi)</dd>
<dt>电池</dt>
<dd>3220 mAh</dd>
<dt>相机</dt>
<dd>13MP rear-facing with optical image stabilization 2MP front-facing</dd>
<dt>处理器</dt>
<dd>Qualcomm® Snapdragon™ 805 processor</dd>
</dl>
</details>
</body>
</html>
回答完毕,采纳即可。