jQuery

来源:互联网 发布:js 取数组前几个 编辑:程序博客网 时间:2024/06/17 23:10

//全选

 $(":checkbox:first").click(function()
         {
             var ss=$(":checkbox:first").prop("checked");
             if(ss)
             {
                 $(":checkbox").prop("checked",true);
             }else
             {
                 $(":checkbox").prop("checked",false);
             }
         });

//删除

 $("button:eq(1)").click(function()
         {
             $("#tabletwo :checked").not("[id]").parent().parent().remove();
         });

//得到单选的值

   var sex = $('[name="sex"]:checked').val();

原创粉丝点击