Step information :
After your label element, and on a new line in your template string, create an input element. Give it a type attribute set to text , a placeholder attribute set to Name , and an id attribute that matches the for attribute of your label element.
my Answer :
function addEntry() {
const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
const HTMLString = `
<label for="${entryDropdown.value}-${entryNumber}-name">Entry ${entryNumber} Name</label>
\n<input type="text" id="${entryDropdown.value}-${entryNumber}-name" placeholder="Name">
`;
}
Problem :
You should add an input element on a new line.
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 46