-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEventsinjavaScript.html
118 lines (104 loc) · 3.04 KB
/
EventsinjavaScript.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Events in Javascript</title>
<style>
body{
background-color: violet;
text-align: center;
}
button{
box-sizing: border-box;
height: 50px;
width: 150px;
padding: 10px;
margin: 70px 0px;
background-color: tomato;
color: white;
box-shadow: 5px 5px 5px black;
display: block;
cursor: pointer;
}
.btn{
justify-content: center;
display: flex;
align-items: center;
flex-direction: column;
}
#box{
height: 150px;
width: 150px;
color: aquamarine;
padding: 10px;
margin: 70px 0px;
background-color: tomato;
color: white;
box-shadow: 5px 5px 5px black;
display: block;
cursor: pointer;
}
input{
height: 50px;
width: 150px;
background-color: #fff;
box-shadow: 5px 5px 5px black;
cursor: pointer;
}
label{
color: #fff;
}
.label{
margin-top:90px; ;
}
#selectBox{
padding: 10px;
box-shadow: 5px 5px 5px black;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Events in Javascript</h1>
<div class="btn">
<!-- ways of events -->
<!-- <button onclick="alert('Hi! I am Usman Whatever Am I')">Using Alert</button>
<button onclick="call()">Simple Callig Function</button>
<button id="event">Add Event Listner</button>
<button id="event1">Inline Event</button> -->
<!-- mouse event
<button id="event">Add Event Listner</button> -->
<!-- Mouse Event -->
<!-- <p id="myP" onmousedown="mDown()" onmouseup="mUp()"> Lorem ipsum dolor sit amet consectetur, adipisicing elit. Consequatur ad nemo iste molestias quaerat quibusdam corporis, non similique, necessitatibus modi voluptate. Nobis, perspiciatis reiciendis corrupti fugit laborum neque incidunt repudiandae.</p>
</div> -->
<!-- <button id="click">Click Me</button> -->
<!-- box -->
<!-- <div id="box"></div> -->
<!-- keyboed Events -->
<!-- <p>Hi! HERE I AM PRESSING DIFFERENT BUTTONS</p>
<br>
<input type="text" onkeypress="keypress()" onkeydown="kDown()" onkeyup="kUp()">
<br>
<p id="myText"></p> -->
<form action="">
<label for="" >Name:
<input type="text" id="name">
</label>
<br>
<div class="label">
<label id="Select" onchange="slectBtn()" for="">Select your Favorite One
<select name="" id="selectBox">
<option value="">Select One ...</option>
<option value="Choclate">Choclate</option>
<option value="Vanilla">Vanilla</option>
<option value="Sardine">Sardine</option>
</div>
</select>
</label>
</form>
<p id="output"></p>
<script src="./script/EventsinjavaScript.js"></script>
</body>
</html>