I'm trying to setup a select checkbox Button from which, using jQuery, when select checkbox button will hide (opt2) DIV and unselect checkbox Then show div. I have most of the functionality working, I just can't get the hide DIV to displayed unSelect is selected. This is my code so far:
<style type="text/css">
.desc{ display: none; }
</style>
<div> Delivery Details</div>
<label><input type="checkbox" name="group1" value="opt2">Same as Billing Details</label>
<div id="opt2" class="desc"> Billing Details Form</div>
$(document).ready(function(){
$("input[name$='group1']").click(function() {
var test = $(this).val();
$("div.desc").show();
$("#"+test).hide();
});
});
What can i do?