hi totally blind using jaws 2026, windows 11 pro, google chrome. up to step 30. of this project. now it is not passing step 30. so will explain whats happening. create 2 paragraph tags in the product container. but it is not passing, have researched online to understand. looked at some example code, and looks the same or similar. it is not passing, and fcc system should be more forgiving and more screen reader friendly. i know i am the only blind person on the forum, trying my best and want to learn, so how to get this to pass. and what code to use to get it to pass, and why is it so strict and what is it actually looking for? pasting my java script code, the error and the link to the step. so can you help me out? i also tried resetting the lesson, hard refresh of the syste, and rewrote the function a few times, but it is not passing, so can any one help?
driving me crazy.
marvin.
ps: pasting below.
java script:
// Step 1-5: Grab DOM elements
const cartContainer = document.getElementById("cart-container");
const productsContainer = document.getElementById("products-container");
const cartBtn = document.getElementById("cart-btn");
const clearCartBtn = document.getElementById("clear-cart-btn");
const totalNumberOfItems = document.getElementById("total-items");
const cartSubTotal = document.getElementById("subtotal");
const cartTaxes = document.getElementById("taxes");
const cartTotal = document.getElementById("total");
const showHideCartSpan = document.getElementById("show-hide-cart");
// Step 6-12: Products array
const products = [
{ id: 1, name: "Vanilla Cupcakes (6 Pack)", price: 12.99 },
{ id: 2, name: "French Macaron", price: 3.99 },
{ id: 3, name: "Pumpkin Cupcake", price: 3.99 },
{ id: 4, name: "Chocolate Cupcake", price: 5.99 },
{ id: 5, name: "Chocolate Pretzels (4 Pack)", price: 10.99 },
{ id: 6, name: "Strawberry Ice Cream", price: 2.99 },
{ id: 7, name: "Chocolate Macarons (4 Pack)", price: 9.99 },
{ id: 8, name: "Strawberry Pretzel", price: 4.99 },
{ id: 9, name: "Butter Pecan Ice Cream", price: 2.99 },
{ id: 10, name: "Rocky Road Ice Cream", price: 2.99 },
{ id: 11, name: "Vanilla Macarons (5 Pack)", price: 11.99 },
{ id: 12, name: "Lemon Cupcakes (4 Pack)", price: 12.99 }
];
// Step 13-30: Render products (Step 30 requirement)
products.forEach(({ name, price }) => {
const productDiv = document.createElement("div");
const pName = document.createElement("p");
pName.textContent = name;
const pPrice = document.createElement("p");
pPrice.textContent = `$${price}`;
productDiv.appendChild(pName);
productDiv.appendChild(pPrice);
productsContainer.appendChild(productDiv);
});
// Step 20-29: ShoppingCart class
class ShoppingCart {
constructor() {
this.items = [];
this.total = 0;
this.taxRate = 8.25;
}
addItem(id, products) {
const product = products.find(item => item.id === id);
this.items.push(product);
const totalCountPerProduct = {};
this.items.forEach(item => {
totalCountPerProduct[item.id] = (totalCountPerProduct[item.id] || 0) + 1;
});
const currentProductCount = totalCountPerProduct[product.id];
const currentProductCountSpan = document.getElementById(`product-count-for-id${id}`);
if (currentProductCount > 1) {
currentProductCountSpan.textContent = `${currentProductCount}x`;
} else {
productsContainer.innerHTML += `<div id="dessert${id}"></div>`;
}
}
}
error:
You should add two p elements inside your div element.
link to the step: