-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (30 loc) · 1016 Bytes
/
script.js
File metadata and controls
36 lines (30 loc) · 1016 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
29
30
31
32
33
34
function addedAlert(Product 1) {
alert("you have added " + Product 1 + " to your cart")
console.log(Product 1 + " added to cart")
}
function addedAlert(Product 2) {
alert("you have added " + Product 2 + " to your cart")
console.log(Product 2 + " added to cart")
}
let navLinks = document.querySelectorAll("li");
for(let i = 0; i < navLinks.length; i++){
navLinks[i].addEventListener("mouseover", function(){
navLinks[i].style.color = "blue";
});
}
for(let i = 0; i < navLinks.length; i++){
navLinks[i].addEventListener("mouseout", function() {
navLinks[i].style.color = "white";
});
}
Element = document.getElementById("lego");
Element.addEventListener("click", function() {
alert("you have clicked the logo")
});
let footerElement = document.getElementById("hero");
footerElement.addEventListener("click", function() {
alert("you have clicked the footer")
});
footerElement.addEventListener("mouseover", function() {
footerElement.style.color = "blue";
});