-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfilter.js
More file actions
executable file
·59 lines (49 loc) · 1.72 KB
/
filter.js
File metadata and controls
executable file
·59 lines (49 loc) · 1.72 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
document.querySelector(".name").addEventListener("click", gotoHomeFun)
function gotoHomeFun() {
window.location.href = "index.html"
}
document.querySelector("#gotoMen").addEventListener("click", gotoMenFun)
function gotoMenFun()
{
window.location.href="mens.html"
}
document.querySelector("#gotoWomen").addEventListener("click", gotoWomenFun)
function gotoWomenFun()
{
window.location.href="womens.html"
}
document.querySelector("#gotoShoes").addEventListener("click", gotoShoesFun)
function gotoShoesFun() {
window.location.href = "shoes1.html"
}
var searchedItem = JSON.parse(localStorage.getItem("searched"))
console.log(searchedItem)
document.querySelector(".name").addEventListener("click", gotoHomeFun)
function gotoHomeFun()
{
window.location.href="index.html"
}
var type = document.createElement("p")
// type.innerText = searchedItem[0].type
// console.log(searchedItem[0].category)
document.querySelector(".searched").append(type)
document.querySelector("#container").innerHTML = "";
searchedItem.map(function (ele) {
var box = document.createElement("div")
var img = document.createElement("img")
img.src = ele.img
img.style.width = "220px"
var price = document.createElement("p")
price.textContent = "$" + " " + ele.price
price.style.color = "Orange"
price.style.fontWeight = "600"
price.style.textAlign = "center"
var strikeoff = document.createElement("p")
strikeoff.textContent = "$" + " " + ele.strikeOff
strikeoff.style.textDecoration = "line-through"
strikeoff.style.color = "red"
strikeoff.style.textAlign = "center"
box.append(img, price, strikeoff)
box.style.margin = "18px 12px 12px 12px"
document.querySelector("#container").append(box)
})