在不使用Javascript的情况下切换div [英] Toggle divs without using Javascript

查看:139
本文介绍了在不使用Javascript的情况下切换div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想切换< div> ,但我的要求是必须使用 javascript 关闭。我想选择一个超链接,声明修改搜索和包含搜索条件的div显示。

I'd like to toggle a <div>, but my requirement is that it must work with javascript turned off. I would like to select a hyperlink that states "modify search" and the div that contains the search criteria displays.

我发现了一个TON的演示使用 jQuery ,但他们都需要 javascript 启用。任何援助赞赏。

I've found a TON of demos using jQuery, but they all require javascript enabled. Any assistance is appreciated.

推荐答案

在这里,船长! 更新为科学)

HTML:

<label for=cb>Click Here</label>
<input type='checkbox' style='display: none' id=cb>
<div>
    Hello. This is some stuff.
</div>

CSS:

input:checked + div { display: none; }

这篇关于在不使用Javascript的情况下切换div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆