给你重新写了个JS 这次 我测试过了 上下 都可以遍历比较 注意$("[id*='A']"). 需要你根据实际需求 自行修改列号 这句是比较A列 var exist=false; var self=this; var s; $("[id*='A']").each(function(){ if($(this).text()==self.getValue()){ exist=true; } }); if(exist){ alert("此数据已存在"); this.setValue(''); this.setText(''); return false; } 编辑于 2018-2-28 17:23 编辑于 2018-2-28 17:24 我就是把A改成B列了 |