-
Notifications
You must be signed in to change notification settings - Fork 0
/
Almost all events in js.html
80 lines (67 loc) · 2.32 KB
/
Almost all events in js.html
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
<!DOCTYPE html>
<html>
<body>
<script>
function change()
{
document.getElementById('p1').innerHTML="<p id=\"p1\" style=\"background-color: navajowhite\">\n" +
" Page Loaded\n" +
" </p>";
}
function change1()
{
document.getElementById('p2').innerHTML="<p id=\"p2\" style=\"background-color: orangered\">\n" +
" Page Loaded\n" +
" </p>";
}
function change2()
{
document.getElementById('p3').innerHTML="<p id=\"p3\" style=\"background-color: white\">\n" +
" Page Loaded\n" +
" </p>";
}
function reset()
{
document.getElementById('p1').innerHTML="<p id=\"p1\" style=\"background-color: aqua\">\n" +
" There is something\n" +
" </p>";
document.getElementById('p2').innerHTML="<p id=\"p2\" style=\"background-color: aqua\">\n" +
" There is something\n" +
" </p>";
document.getElementById('p3').innerHTML="<p id=\"p3\" style=\"background-color: aqua\">\n" +
" There is something\n" +
" </p>";
}
function cheating()
{
alert("You pressed a key inside the input field");
}
function hack()
{
alert("Nasa Hacked successfully");
}
</script>
<p id="p1" style="background-color: aqua">
There is something
</p>
<p id="p2" style="background-color: aqua">
There is something
</p>
<p id="p3" style="background-color: aqua">
There is something
</p>
<div style="margin:10px;">
<button onmouseover="change()"> Mouse Over Me</button>
<button onmouseover="change1()"> Mouse Over Me</button>
<button onmouseover="change2()"> Mouse Over Me</button>
</div>
<div style="margin:30px 50px;">
<button onclick="reset()">Click to Reset </button>
</div>
<div style="margin:30px 50px;">
<label> Input this </label>
<input type="text" onkeydown="cheating()">
<button onmouseout="hack()">Mouse out to Hack NASA</button>
</div>
</body>
</html>