【发布时间】:2013-07-07 19:39:42
【问题描述】:
考虑以下段落和列表:
<p id = "list1" onclick = "openList1()">List of Items</p>
<ol>
<li><a href = "/exampleFolder/file1.txt">List Item 1</a></li>
<li><a href = "/exampleFolder/file2.txt">List Item 2</a></li>
<li><a href = "/exampleFolder/file3.txt">List Item 3</a></li>
<li><a href = "/exampleFolder/file4.txt">List Item 4</a></li>
<li><a href = "/exampleFolder/file5.txt">List Item 5</a></li>
</ol>
如何使用 Javascript 显示和隐藏整个列表?
<script>
function openList1() {
...
}
</script>
感谢您的关注!
【问题讨论】:
-
谷歌“显示和隐藏一个 div”,你会看到很多方法。
标签: javascript html list onclick show