Values
An expression with string
, number
and object
value in the body of an element resolves to textContent
:
html`<div>Name: ${name}, Count: ${count}</div>`;
HTML code can be created by the innerHTML
property. However, use it with caution, as it might open XSS attack:
// Use it with caution, it might open XSS attack
html`<div innerHTML="${htmlCode}"></div>`;
Last updated
Was this helpful?