-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvalidate.html
More file actions
48 lines (47 loc) · 1013 Bytes
/
validate.html
File metadata and controls
48 lines (47 loc) · 1013 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>email check</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<style type="text/css">
label{
position: relative;
padding: 4px;
width: 50px;
float: left;
}
input{
height:40px;
font-style: sans-serif;
font-size: 120%;
border-radius: 5%;
border:2px grey solid;
text-align: center;
}
div {
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
<div id="wrapper">
<label for="email">Email</label><input type="text" name="email" placeholder="ajitmujumdar25999@gmail.com" id="aaa">
</div>
<div><button>Submit</button></div>
<script type="text/javascript">
var regex1=/.com/;
var regex2=/@/;
var string="";
$("button").click(function(){
string=document.getElementById("aaa").value;
if(string.match(regex1)!=null && string.match(regex2)!=null)
alert("correct email");
else
alert("incorrect email");
});
</script>
</body>
</html>