2 years ago
#63025
spidyCZZ
Hide/display div with "select option rule" with pure css
there is good trick to hide/display div or another content with checkboxes/radio inputs and pure css like in example bellow.
.theTrick {display:none;}
#display_yes:checked ~ .theTrick {display: block;}
<input type="radio" id="display_yes" name="display" value="somethin">
<label for="display_yes">YES</label>
<input type="radio" id="display_no" name="display" value="somethin">
<label for="display_no">NO</label>
<div class="theTrick">Hello world!</div>
https://jsfiddle.net/dz1vLxqu/
Its pretty cool and without external scripts. Is there solution for to do this with dropdown list instead of checkboxes?
<select>
<option>
...
html
css
dropdown
hide
display
0 Answers
Your Answer