?$("input[name='phonf']").blur(function () {? ? ? ? if ($(this).val() == '') {? ? ? ? ? ? $(this).attr('placeholder', '聯(lián)系手機(jī)不能為空')? ? ? ? ? ? return? ? ? ? } else {? ? ? ? ? ? $(this).attr('placeholder', '')? ? ? ? }? ? ? ? var reg1 = /^1[345678]\d{9}$/;? ? ? ? if (reg1.test($(".phonf").val())) {? ? ? ? ? ? return? ? ? ? } else {? ? ? ? ?$(".phonf").val()==""? ? ? ? ? ? alert("錯誤");? ? ? ? }? ? });
為什么清空這行代碼沒起作用 我需要的是 沒有通過正則 input 清空
小菜鳥__
2017-04-08 11:07:16