<!DOCTYPE html><html><head><meta charset="UTF-8"><title>显示隐藏</title><style>#div1{width: 100px;height: 400px;background-color: #ccc;display: none;}</style></head><body><input type="button" value="Button" onclick="showHide()"><div id="div1"></div><script>function showHide() {var oDiv = document.getElementById('div1')if (oDiv.display == 'block');oDiv.display = 'none'elseoDiv.display = 'block';}</script></body></html>
添加回答
举报
0/150
提交
取消