function test() 2 { 3 var temp = document.getElementById("text1"); 4 //對電子郵件的驗證 5 var myreg = /^([a-zA-Z0-9 ...
一.相關的代碼 functiontest vartemp document.getElementById text 對電子郵件的驗證 varmyreg a zA Z . a zA Z a zA Z . a zA Z . a zA Z , if myreg.test temp.value alert 提示 n n請輸入有效的E mail myreg.focus returnfalse 由於方法相同 ...
2013-06-28 19:54 0 50662 推薦指數:
function test() 2 { 3 var temp = document.getElementById("text1"); 4 //對電子郵件的驗證 5 var myreg = /^([a-zA-Z0-9 ...
說明:input框輸入郵箱,失去焦點后自動獲取驗證 以上正則不一定滿足需求,可參考另一篇博客,常用正則表達式—郵箱(Email):https://www.cnblogs.com/clubs/p/12666702.html ...
轉載自:https://www.cnblogs.com/dyllove98/archive/2013/06/28/3161626.html 一.相關的代碼 二.解釋相關的意義 1. /^$/ 這個是個通用的格式。 ^ 匹配輸入 ...
/^([a-zA-Z\d])(\w|\-)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/ ...
...
<form action=""> 輸入:<input type="text" name="mazey" id="mazey" placeholder="請輸入郵箱"> <input type="button" value="驗證" onclick="check ...
...