js郵箱格式檢測(cè)判斷
<script type="text/javascript">
function ischeckemail(){
var email = document.getElementById("emailname").value;
if(email != "") {
var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
//調(diào)用正則驗(yàn)證test()函數(shù)
isok= reg.test(email);
if(!isok) {
alert("郵箱格式不正確,請(qǐng)重新輸入!");
document.getElementById("emailname").focus();
return false;
}
};
}
</script>
<input type="text" id="emailname">
<input type="submit" value="檢測(cè)Email地址格式是否正確" click="return ischeckemail()">
如果您的問(wèn)題還未解決可以聯(lián)系站長(zhǎng)付費(fèi)協(xié)助。

有問(wèn)題可以加入技術(shù)QQ群一起交流學(xué)習(xí)
本站vip會(huì)員 請(qǐng)加入無(wú)憂模板網(wǎng) VIP群(50604020) PS:加入時(shí)備注用戶名或昵稱
普通注冊(cè)會(huì)員或訪客 請(qǐng)加入無(wú)憂模板網(wǎng) 技術(shù)交流群(50604130)
客服微信號(hào):15898888535
聲明:本站所有文章資源內(nèi)容,如無(wú)特殊說(shuō)明或標(biāo)注,均為采集網(wǎng)絡(luò)資源。如若內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系站長(zhǎng)刪除。