-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregExp.html
More file actions
29 lines (23 loc) · 746 Bytes
/
Copy pathregExp.html
File metadata and controls
29 lines (23 loc) · 746 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
<html>
<head>
<script type="text/javascript">
function fun(){
var a=document.getElementById("inp").value;
var b=document.getElementById("but");
var r=/[a-c]bc/;
if(r.test(a)){
document.getElementById("lab").style.visibility="hidden";
alert("founded");
}
else{
document.getElementById("lab").style.visibility="visible";
}
}
</script>
</head>
<body>
<input id="inp" placeholder="enter_Text">
<label id="lab" style="color: red;visibility:hidden">Invalid Username</label>
<button id="but" onclick="fun()" type="button">click me</button>
</body>
</html>