Build a Calorie Counter - Step 47

Tell us what’s happening:

Step 47 is failing and the alert message says: “Your label element should have the text Entry ${entryNumber} Name.”

However, when I look at that line of code, that is exactly what I see. I am not sure what I’m missing for this one. Thanks!

Your code so far

const calorieCounter = document.getElementById('calorie-counter');
const budgetNumberInput = document.getElementById('budget');
const entryDropdown = document.getElementById('entry-dropdown');
const addEntryButton = document.getElementById('add-entry');
const clearButton = document.getElementById('clear');
const output = document.getElementById('output');
let isError = false;

function cleanInputString(str) {
  const regex = /[+-\s]/g;
  return str.replace(regex, '');
}

function isInvalidInput(str) {
  const regex = /\d+e\d+/i;
  return str.match(regex);
}

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  const HTMLString = `<label>Entry ${entryNumber} Name</label>`;
}

Your browser information:

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

Challenge Information:

Build a Calorie Counter - Step 47

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-calorie-counter/63c2171c1e5b6e3aa51768d0.md at main · freeCodeCamp/freeCodeCamp · GitHub

You changed the starting code, which will cause the tests to fail. Please reset this step and try again, being careful to add the label on the line highlighted in the editor. Do not rearrange the code to put it all on one line.

Thanks @dhess ! That solved the test case.