jQuery给CheckBox添加事件

<asp:CheckBox ID="ckbTable" runat="server" Checked="false" />
<table id="table" style="display:none" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>123</td>
</tr>
</table>
$(function(){
$("#ckbTable").click(function () {
                if (this.checked) {
                    $("#table").css("display", "block");
                }
                else {
                    $("#table").css("display", "none");
                }
            });
});
posted @ 2014-09-04 08:53  Liu66~  阅读(860)  评论(0编辑  收藏  举报