-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjavascript.html
More file actions
98 lines (98 loc) · 2.37 KB
/
javascript.html
File metadata and controls
98 lines (98 loc) · 2.37 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<title>Javascript</title>
<style type="text/css">
#green{
background: green;
}
#yellow{
background: yellow;
}
#blue{
background: blue;
}
.box{
width: 30px;
height: 30px;
border-radius: 50%;
position: relative;
float: left;
margin: 10px;
}
.clear{
clear: all;
}
</style>
</head>
<body>
<p id="ajir">Hello there</p>
<button onclick="mt()">Click here</button>
<button id="tea">Change text</button>
<p id="po">okay this is my test</p>
<button id="poy" >style</button>
<br>
<p id="green" class="box"></p>
<p id="yellow" class="box"></p>
<p id="blue" class="box"></p>
<br>
<br>
<br>
<input type="text" id="oks">
<button id="chg">change text</button>
<p id="popo">this is gonna change</p>
Check this: <input type="text" id="check">
<button id="anns">Check</button>
<br>
<p id="erww"></p>
<button id="erwwq">Make a guess</button>
<div id="testingloop"></div>
<script type="text/javascript">
function mt(){
alert("hi");
}
document.getElementById("tea").onclick=function(){
document.getElementById("ajir").innerHTML+="Hey here!\n";
}
document.getElementById("poy").onclick=function(){
document.getElementById("po").style.color="green";
document.getElementById("po").style.fontStyle="italic";
}
document.getElementById("green").onclick=function(){
document.getElementById("green").style.display="none";
}
document.getElementById("yellow").onclick=function(){
document.getElementById("yellow").style.display="none";
}
document.getElementById("blue").onclick=function(){
document.getElementById("blue").style.display="none";
}
document.getElementById("chg").onclick=function(){
var tess="";
tess+=document.getElementById("oks").value;
document.getElementById("popo").innerHTML=tess;
}
var arr=new Array();
arr[0]="hello";
arr[1]="sss";
var trr=["asa","asasa"];
trr.push("aaAqq");
trr.splice(1,1,"osssa");
console.log(trr);
document.getElementById("anns").onclick=function(){
var x=document.getElementById("check").value;
if(x=="ajit")
alert("it's a match");
else
alert("it's not a match"); }
document.getElementById("erwwq").onclick=function(){
document.getElementById("erww").innerHTML=Math.floor(Math.random()*6);
}
var uth="";
var aee=["hello","hi","okay","bye"];
for(var i=0;i<aee.length;i++)
uth=uth+"<p>"+aee[i]+"</p>";
document.getElementById("testingloop").innerHTML=uth;
</script>
</body>
</html>