【发布时间】:2021-11-27 02:46:05
【问题描述】:
我只想在单选按钮为YES 时显示“我们很抱歉...” 消息和“黑框”,否则不要'不显示。
我需要只用 JavaScript 来做吗,还是只用 HTML 就可以?
<h3 >Did you encounter any issues during your stay?</h3>
<label class="container">Yes
<input type="radio" name="radio">
<span class="checkmark"></span>
</label>
<label class="container">No
<input type="radio" checked="checked" name="radio">
<span class="checkmark"></span>
</label>
<h3 >We’re so sorry to hear this.
<br>
If you would like to share, please tell us what happened.
</h3>
<input type="text" id="problem" name="problem" style = "height: 200px; background-color: #a4acba; border-color: black;">
提前致谢。
【问题讨论】:
-
你必须使用 JavaScript
input或change事件,它应该设置一个 CSS 类。我更喜欢input,因为它不需要在大多数浏览器中出现blur。 -
你好@PavolBujna!你能解释一下“黑匣子”是什么意思吗?
-
我的意思是“文本输入”,底部有一个黑框
标签: javascript html css radio-button