Learn Form Validation by Building a Calorie Counter - Step 44

Tell us what’s happening:

${<label>Entry + entryNumber + Name </label>}
I’m trying to use template lateral to with a label but its not working. i put the label element and its still asking me for it!

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 44

Hi @imukhtar44 , thank you for your question.

It seems you are not using template literals correctly. They are marked with backticks - `` - rather than quotes “”.

What this allows you to do is instead of writing

let string = "<label>Entry " + entryNumber + " Name</label>";

you can write

let string = `<label>Entry ${entryNumber} Name</label>`;

The point of the literal is to have the ability to inline variables and expressions instead of concatenating the string with +.

Hope this answers your question sufficiently.

Good luck!

Thank you [quote=“imukhtar44, post:1, topic:673248, full:true”]

Tell us what’s happening:

${<label>Entry + entryNumber + Name </label>}
I’m trying to use template lateral to with a label but its not working. i put the label element and its still asking me for it!

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 44

[/quote]
Yeah It work . Thank you

Great to hear that! It would be great if you marked my answer as the solution if it worked for you :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.