Here is the jquery way:
$( ".show" ).click(function() {
$('#thing').fadeIn();
});
$( ".hide" ).click(function() {
$('#thing').fadeOut();
});
option 2
$( ":radio" ).click(function() {
if ($(this).hasClass('show')){
$('#thing').fadeIn();
} else if ($(this).hasClass('hide')) {
$('#thing').fadeOut();
}
});
HTML:
<input id="rbone" type="radio" name="group" class="show" />
<label for="rbone">Show</label>
<br />
<input id="rbtwo" type="radio" name="group" class='hide'/>
<label for="rbtwo">Hide</label>
<div id="thing">
<p>
Nothing to see here
</p>.</div>
jsfiddle. , "app.js", html ,
<script src="app.js"></script>