- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
24 lines (17 loc) · 557 Bytes
/
Copy pathscript.js
File metadata and controls
24 lines (17 loc) · 557 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
document.getElementById("myh1").onclick=function(){
document.getElementById("myh1").innerHTML="This is the updated header"
};
document.getElementById("myp").onclick=function(){
alert(document.getElementById("myp").innerHTML)
};
functionvalidate(){
varusr=document.getElementById("username").value;
varmatches=usr.match(/\d+/g);
if(usr=="12345")
alert("You are right");
elseif(matches!=null){
alert(" Username has atleast one number");
}
else
alert("You are not right");
}