Template literal with html element code example
Example: using template literals to create html
const createMarkup = function createMarkup(data) {
// Just use the same syntax for node elements
const markup =
`<ul id="listItem-${data.name}">
<li>Name: ${data.name}</li>
<li>Age: ${data.age}</li>
<li>Gender: ${data.gender}</li>
<li>Fav. Colour: ${data.colour}</li>
<li>Lucky Number: ${data.number}</li>
</ul>`;return markup;
};