On my form, there are two radio buttons to choose from: one for "yes" and the other for "no". I am looking to create a feature that will hide a specific div on the form when the "no" option is selected. I have tried various JavaScript solutions found online, but none of them seem to work for me.
Can anyone provide the correct code for this functionality? It could be in JavaScript, PHP, or CSS.
Below is the snippet of my current code:
<div class="form-radio">
<label for="sons" class="radio-label">Question:</label>
<div class="form-radio-item">
<input type="radio" name="yes" id="yes" checked value="YES">
<label for="hsi">YES</label>
<span class="check"></span>
</div>
<div class="form-radio-item">
<input type="radio" name="no" id="no" value="NO">
<label for="hno">NO</label>
<span class="check"></span>
</div>
</div>
<div id="hello">
You clicked on NO, so this div disappears.
</div>