-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathE-mailVerfication.html
More file actions
50 lines (41 loc) · 1.49 KB
/
Copy pathE-mailVerfication.html
File metadata and controls
50 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
<head>
<title>E-mail verificaion</title>
<h1>EMAIL VERIFICATION</h1>
<script type="text/javascript">
function func1()
{
var email = document.getElementById("email").value
var regx =/^([A-Za-z0-9\.-]+)@([a-zA-Z0-9-]+).([a-z]{2,8})(.[a-z]{2,8})?$/
if(regx.test(email))
{
alert("valid email")
document.getElementById("label").innerHTML = "valid";
document.getElementById("label").style.visibility = "visible";
document.getElementById("label").style.color = "green";
}
else
{
{
alert("invalid email")
document.getElementById("label").innerHTML = "invalid";
document.getElementById("label").style.visibility = "visible";
document.getElementById("label").style.color = "red";
}
}
}
</script>
</head>
<body>
<form action="">
<input type="text" name="email" id="email" placeholder="enter youe email address">
<br>
<br>
<label for="" id ="label" style="color: red;visibility: hidden;">Invalid</label>
<br>
<br>
<button onclick="func1()"> CLICK ME</button>
<img src="a.jpg" alt="" width="300">
</form>
</body>
</html>