<script> $(document).ready(function(){ //点击删除考生按钮 $(".del_examinee").click(function(event){ event.preventDefault(); if(!confirm("确定要删除吗?")){ return false; } window.location.href=$(this).attr("href"); }); //点击批量删除按钮 $(".del_examinees").click(function(event){ /*event.preventDefault();*/ var $count=0; $('#container1 input[type="checkbox"]').each(function(index,el){ if($(el).prop("checked")==true){ $count++;} }); if(!$count){ alert("请选择要删除的数据"); return false; }else { if(!confirm("您确定要删除数据吗?")){ return false; } } $(".del_examinees").submit(); }); //tab标签切换 var tab=<?php echo $this->session->userdata('tab')?$this->session->userdata('tab'):0;?>; $(".tab li").eq(tab).addClass("cur"); $(".content").hide().eq(tab).show(); $(".tab li").click(function(){ $(".tab li").eq($(this).index()).addClass("cur").siblings().removeClass('cur'); $(".content").hide().eq($(this).index()).show(); $.ajax({ url:"<?php echo site_url("admin_index/set_session");?>", type:"post", dataType:"json", data:{tab:$(this).index()}, success:function(data){ } }); }); //复选框全选全不选 $("#select_all").bind('click',function(){ $('#container1 input[type="checkbox"]').each(function(index,element) { if($(element).prop("checked")==true){ $(element).prop("checked",false); }else{ $(element).prop("checked",true); }}); }); //点击删除考官按钮 $(".del_examiner").click(function(event){ event.preventDefault(); if(!confirm("确定要删除吗?")){ return false; } window.location.href=$(this).attr("href"); }); }); $(document).keydown(function (event) { if (event.keyCode == 13) { //捕获回车事件 $("#btn_sub").trigger("click"); //模拟点击登录 } }); </script> var val = $('input:radio[name="v_result"]:checked').val();
jquery
最新推荐文章于 2022-03-28 10:57:04 发布