Build an Envelope Budget App - Step 47

Tell us what’s happening:

I keep getting this message: 1. Your label element should have a for attribute set to {category}-{entryNumber}-name.
2. Your label element should have the text “Expense ${entryNumber} Name”
Step 47 says: Give your element a for attribute with the value X-#-name, where X is the value of the category variable and # is the value of entryNumber. Remember that HTML attributes should be wrapped in double quotes.
What am I missing? I have been staring at this all day. Thank you.

Your code so far

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

/* file: styles.css */

/* file: script.js */
// User Editable Region
  function addEntry() {
    const category = entryDropdown.value;
    const targetInputContainer = document.querySelector(`#${category} .input-container`);
    const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
// User Editable Region

Your browser information:

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

Challenge Information:

Build an Envelope Budget App - Step 47

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-envelope-budget-app/69b2c970cb02ddaafff1c10c.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hi @admagee63

Where is the HTMLString constant and value?

  const HTMLString = `
  <label>Expense ${entryNumber} Name</label>`;

Please reset the step and try again.

Happy coding

Got it! I fixed the issue. Thanks for the pointer.