-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
45 lines (38 loc) · 1.63 KB
/
script.js
File metadata and controls
45 lines (38 loc) · 1.63 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
function sendToPage(){
var input = document.getElementById("search").value;
// var inputs = input.toLowerCase()
// productList.forEach( product =>
// productName = product.name
// )
// if (input.toLowerCase() == productName) {
// console.log(productName)
// location.href = "articles/tops.html";
// location.href = "articles/jeans.html";
// location.href = "articles/accesoires.html";
// location.href = "articles/chaussures.html";
// return false;
// }
// else {
// alert('Cet article est indisponible.');
// }
// }
if (input.toLowerCase() == "robe" || input == "T-shirt" || input == "chemise" || input == "top" || input == "haut" || input == "pull"){
location.href = "articles/tops.html";
return false;
}
else if (input.toLowerCase() == "jeans" || input == "jean" || input == "pantalon" || input == "pantalons"){
location.href = "articles/jeans.html";
return false;
}
else if (input.toLowerCase() == "accessoire" || input == "accessoires" || input == "sac" || input == "lunette" || input == "lunettes" || input == "masque"){
location.href = "articles/accesoires.html";
return false;
}
else if (input.toLowerCase() == "chaussure" || input == "chaussures" || input == "talon" || input == "talons" || input == "escarpin" || input == "basket" || input == "converse"){
location.href = "articles/chaussures.html";
return false;
}
else {
alert('Cet article est indisponible.');
}
}