js判斷 不能重復輸入相同的內容
阿新 • • 發佈:2018-01-17
document for put blog on() 判斷 gpo 輸入 內容
$(document).on(‘input propertychange‘,‘.level‘,function(){
var val = $(this).val();
var ind = $(this).index(‘.level‘);
var len = $(‘.level‘).length;
for(var i =1 ; i<len; i++){
if(ind != i){
if(val == $(‘.level‘).eq(i).val() ){
that.errorMsg(‘不能重復輸入‘);
$(this).val(‘‘);
}
}
};
});
js判斷 不能重復輸入相同的內容