I have a script to make a div
appear or disappear, depending if a checkbox is checked or not... it works fine.
However, I wish to adapt this script to do the same for radio buttons, depending if one specific value is selected or not.
This would looks like this:
<input type="radio" name="data" id="showDiv" value="1">
<input type="radio" name="data" value="2">
<div id="showMe">Hello</div>
And the JavaScript I wish to modify looks like this:
$('[name="checkbox"]').on('change', function() {
$('#id').toggle(this.checked);
}).change();