var reg = /\s*/g; $('.modal-content').find('input').focusout(function () { if ($(this).val() == '' || reg.test($(this).value)) { $(this).css('backgroundColor','#FFEFEF'); $(this).nextAll('.hintWrap').css('display','block'); console.log(reg.test($(this).value)); } else { $(this).css('backgroundColor','#F5F5F5'); $(this).nextAll('.hintWrap').css('display','none'); console.log(reg.test($(this).value)); } })
谢谢!
宝慕林4294392
相关分类