Review Algorithmic Thinking by Building a Dice Game - Step 1

Tell us what’s happening:

Hello there to FCC team, I am facing the same issue like everyone , I have assigned the elements to the variables :

const listOfAllDice = document.querySelector(“.die”);

! But it shows me the error message:
Sorry, your code does not pass. Try again.

You should assign your .die elements to listOfAllDice.
I need help, thanks :wink:

Your code so far

<!-- file: index.html -->

/* file: script.js */
// User Editable Region

const listOfAllDice = document.querySelector(".die");
const scoreInputs  = document.getELementById("score-options input");
const scoreSpans =  document.getELementById("score-options span");
const roundElement  = document.getELementById("current-round");
const  rollsElement = document.getELementById("current-round-rolls");
const totalScoreElement = document.getELementById("total-score");
const scoreHistory = document.getELementById("score-history");
const rollDiceBtn = document.getELementById("roll-dice-btn");
const keepScoreBtn = document.getELementById("keep-score-btn");
const rulesBtn  = document.getELementById("rules-btn");
const rulesContainer = document.querySelector(".rules-container");
let isModalShowing  = false;
let diceValuesArr = [];
let rolls = 0;
let score = 0;
let round = 1;


// User Editable Region
/* file: styles.css */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Challenge Information:

Review Algorithmic Thinking by Building a Dice Game - Step 1

There are a few issues with your code:

  1. If you want to select all elements of class ‘.die’, you can’t use querySelector, as that will only return the first element found.
  2. You have mistyped getElementById each time you use it.
  3. You can’t use getElementById to select input or span elements which are children of a an element with a specific id. You’ll need to use the same method as required for listOfAllDice.