-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry2.html
More file actions
68 lines (58 loc) · 1.43 KB
/
Copy pathtry2.html
File metadata and controls
68 lines (58 loc) · 1.43 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#btn{
border:6px solid blue;
height:100px;
width:100px;
}
</style>
</head>
<body>
<div id="btn"> Click</div>
<script>
const btn = document.getElementById("btn");
btn.addEventListener("mouseover",function(){
btn.innerHTML="and my color changed";
btn.textContent="you hovered me!";
btn.style.backgroundColor="red";
});
</script>
</body>
</html>
<!-- onclick haru chai tetekai variable ma kam gardaina ra mouseevent haru use garda geteventlistener nai garnuparcha?
if haina vane inline onclick haru kasari work garcha? -->
<!-- <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#box{
width:200px;
height:100px;
padding:16px;
border:1px solid #000;
}
</style>
</head>
<body>
<div id="box">
Move mouse over this box!
</div>
<script>
const box = document.getElementById("box");
// Let box listen for mouseover
box.addEventListener("mouseover", function () {
box.textContent = "Mouse is over me!";
box.style.backgroundColor= "green";
box.style.color = "red";
});
</script>
</body>
</html> -->