Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Endre-Jobloop committed Oct 22, 2024
1 parent 1a847c1 commit 8ddd8a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ for (let fruit of fruits) {
origin.classList.add("origin")
//stock
const stock = document.createElement("p")
stock.textContent = fruit.stock
stock.textContent = `Stock: ${fruit.stock}`
stock.classList.add("stock")
//product id
const id = document.createElement("p")
id.textContent = fruits.productId
id.textContent = fruit.productId
id.classList.add("id")
//appends
container.append(image, title, description, origin, stock, id)
//sale
if (fruit.sale) {
container.style.backgroundColor = "green"
container.classList.add("on-sale")
const saleNotice = document.createElement("h5")
saleNotice.classList.add("sale-notice")
saleNotice.textContent = `Product is on sale for only ${fruit.price}`
Expand All @@ -145,8 +145,8 @@ for (let fruit of fruits) {
//price
const price = document.createElement("p")
price.classList.add("price")
price.textContent = fruit.price
price.textContent = `Price: ${fruit.price}`
container.append(price)
}
productContainer.append(container)
}
}

0 comments on commit 8ddd8a3

Please sign in to comment.