我正在尝试使用 1-5 比例选项创建调查。如果用户选择 1-3 的值,我想让 javascript 显示一个用于评论的文本框。任何人都可以帮我使用javascript代码吗?
这是我的代码:
<li>
<span class="survey-question">How would you rate your experience with online shopping?</span>
<div class="survey-answer">
<label>
<input class="radio-button" type="radio" name="required" value="1"> Horrible
</label>
<label>
<input class="radio-button" type="radio" name="required" value="2"> Bad
</label>
<label>
<input class="radio-button" type="radio" name="required" value="3"> So-So
</label>
<label>
<input class="radio-button" type="radio" name="required" value="4"> Great
</label>
<label>
<input class="radio-button" type="radio" name="required" value="5" checked> Awesome!
</label>
</div>
<!-- If an answer <= "So-So or less", display: -->
<div id="improvement" class="new">
<span class="survey-question">How can we improve?</span>
<textarea class="col-md-10" rows="3" id="answer" placeholder="Comments..."></textarea>
</div>
</li>