html - 如何在 anchor 处于事件状态时显示 div?

标签 html css anchor

我正在寻找一种在单击 anchor 时显示 div 的方法。 我的页面上有一个 html5/php 表单,提交后会将用户带到放置在 div 中的 anchor ,并带有感谢消息,这是激活该链接的唯一方法。 这是我要显示的 div:

<div style="display:none">
  <span id="thankyou"></span>
  <p>Than you for your message. I will be in touch soon.</p>
</div>

有没有办法更改(可能使用 CSS) anchor 处于事件状态时的显示:无?

最佳答案

您可以尝试使用 javascript 隐藏和显示该元素。这是引用示例的链接 http://css-tricks.com/snippets/javascript/showhide-element/

你也可以使用 jQuery .hide() .show()

关于html - 如何在 anchor 处于事件状态时显示 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17518858/

相关文章:

javascript - IE6 中多个 anchor 标记不起作用

javascript - 从 anchor(a) 标签获取本地 href 值

html - CSS 最小高度无法正常工作

html - 如何设置一行最后一个元素的样式?

javascript - 将 eventListener 添加到按钮以更改类 onmouseup/down

html - 如何制作 anchor 标记以下载 HTML 格式的 JSON 文件?

Javascript:location.replace 和 CSS 类

java - 如何使用 servlet 为 Eclipse 中的所有 html 和 jsp 页面维护唯一的 session ?

css - Font Awesome 在客户端环境中不起作用

html - 垂直居中字段集中的 anchor 标记