- var reg = /^\d+$/;
- $(document).on("click","#c_all",function(){
- var result=0;
- $("input[name='classhour[]']").each(function(){
- result+=Number($(this).val());
- });
- if(!reg.test(result)){
- // if(isNaN(result)){
- alert("ID列只能输入数字");
- return ;
- }
- $("#t_classhour").val(result);
- })
- //统计总课时
- var reg = /^\d+$/;
- $(document).on("click","#c_all",function(){
- var result=0;
- $("input[name='classhour[]']").each(function(){
- result+=Number($(this).val());
- });
- if(!reg.test(result)){
- // if(isNaN(result)){
- alert("ID列只能输入数字");
- return ;
- }
- $("#t_classhour").val(result);
- })
jq判断是为数字
猜你喜欢
转载自www.cnblogs.com/aivnfjgj/p/9023949.html
今日推荐
周排行