-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path14.js
More file actions
28 lines (22 loc) · 730 Bytes
/
14.js
File metadata and controls
28 lines (22 loc) · 730 Bytes
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
function handleClick(element){
element.style = "background-color: red;";
// alert("Clicked");
}
var image = document.getElementById("image");
// image.addEventListener("mouseover", function(){
// this.style = "box-shadow: 2px 2px 2px grey";
// this.width = "110";
// });
// image.addEventListener("mouseout", function(){
// this.style = "";
// this.width = "100";
// });
image.addEventListener("mouseenter", function(){
this.style = "";
this.width = "120";
})
// about the name of "mouseover" and "mouseout"
// check: https://www.w3schools.com/jsref/dom_obj_event.asp
// in HTML file: onmouseover
// in JS file : mouseover
// Note that you don't need "on" in the JS in terms of eventhandlers