-
Notifications
You must be signed in to change notification settings - Fork 0
/
ders15.js
52 lines (38 loc) · 1.04 KB
/
ders15.js
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
var btn = document.getElementById('btn');
var btn2 = document.getElementById('btn2');
var inp = document.getElementById('inp');
btn.addEventListener('dragstart', function (e) {
console.log(e);
});
btn.addEventListener('dragend', function (e) {
console.log(e);
});
btn.addEventListener('click', function () {
alert(1);
});
btn.addEventListener('click', function () {
alert(2);
});
// mdn html events den bakabilirsin
function over(e) {
e.target.style.backgroundColor = 'red';
}
function out(e) {
e.target.style.backgroundColor = '';
}
btn.addEventListener('mouseover', over);
btn.addEventListener('mouseout', out);
btn2.addEventListener('mouseover', over);
btn2.addEventListener('mouseout', out);
inp.addEventListener('focus', function (e) {
e.target.value = 'selam!';
});
inp.addEventListener('blur', function (e) {
e.target.value = '';
});
// keyup tusu b iraktigimiz anda
// keydown bastigimiz anda
// keypress basili oldugu surece
inp.addEventListener('keyup', function (e) {
e.target.value = e.target.value.toUpperCase();
});