Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 html 邮件表单,我想隐藏最后五个输入字段,除非用户通过单击单选按钮或复选框选择加入我们的邮件列表。然后我希望隐藏的字段变得可见。有一个简单的脚本吗?
谢谢(没有代码)
您可以将最后五个输入字段包装在一个 div 中并将样式定义为“显示:无;” 然后将事件绑定到单选按钮,单击时将显示设置为阻止。
尝试查看 CSS 显示属性。在 Javascript 中的 onclick 事件中设置此项。没有一些代码,这就是我能提供的所有帮助。尝试制作一个 JSFiddle,它不必是您正在处理的确切代码,只是一个示例。如果您想要一个严肃、有用的答案,您必须提供更多信息。