Literal string with a variable inserted 1

Literal string with a variable inserted

content.innerHTML += `

${person}

`

Here is what the above code is Doing:
1. We’re creating a variable called content and assigning it to the element with the id of content.
2. We’re creating a variable called person and assigning it to the value of the input field.
3. We’re adding a new paragraph element to the content element.
4. We’re adding the value of the person variable to the new paragraph element.

Similar Posts