【发布时间】:2016-12-21 20:53:07
【问题描述】:
我在 python 中有一个项目,当我的图标被点击时会隐藏一个 div,然后在再次点击它时折叠。现在我有以下html代码
<img scr="/path/to/img"></img>
<div>
<p>Press the icon to see more stuff</p>
</div>
<div id="showOrHide" style="display: none;">
<p>one</p>
<p>two</p>
<p>three</p>
</div>
所以我的问题是,当用户单击图像时,删除 id 为 showOrHide 的 div 上的样式的最佳方法是什么?
谢谢!
【问题讨论】:
-
Python在这个项目中要做什么?
-
为什么提到 Python?您所展示的内容中没有涉及 Python(除非您想要往返于服务器,否则可能不在您想要实现的内容中)。您使用的是 Web 应用程序框架吗?哪一个?
-
您好,欢迎来到 StackOverflow。请花一些时间阅读帮助页面,尤其是名为"What topics can I ask about here?" 和"What types of questions should I avoid asking?" 的部分。更重要的是,请阅读the Stack Overflow question checklist。您可能还想了解Minimal, Complete, and Verifiable Examples。