Learn Form Validation by Building a Calorie Counter - Step 45

Tell us what’s happening:

from step 39 to this step i am not getting the point what this piece of code intends to do , it is not worthy to just mug the code without understanding it . so what is the point for all this code

Your code so far

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

/* file: styles.css */

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

function addEntry() {
  const targetInputContainer = document.querySelector(`#${entryDropdown.value} .input-container`);
  const entryNumber = targetInputContainer.querySelectorAll('input[type="text"]').length;
  const HTMLstring =
}

// 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/126.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 45

Hi there!
Instructions for the challenge step is:
Now you need to build your dynamic HTML string to add to the webpage. Declare a new HTMLString variable, and assign it an empty template literal string.

What do you not understand?

Hi @Mon2

Now you need to build your dynamic HTML string to add to the webpage. Declare a new HTMLString variable, and assign it an empty template literal string.

This is a project based course, so the code you are entering may not make much sense when you write it. The HTMLString variable will be used to enter user input onto the webpage.

If you want a preview, check out step 1.

Happy coding

No you are right but idea and goal should be discussed more subjectively so that we also have some better understanding . Now they are declaring HTML variable and some code of HTML atleast we should know why we are using it here why we didn’t do in index.html