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. 我的大部分功能都在工作,我只是无法让隐藏 DIV 显示 unSelect 被选中。到目前为止,这是我的代码:
<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();
});
});
我能做些什么?