API
fragment From constant
A JavaScript template string literal that returns an HTML document fragment.
Example:
const fragment = fragmentFrom.html`Hello, <em>world</em>.`
returns a DocumentFragment
whose innerHTML
is Hello, <em>world</em>.
This function is called html
so that it can be easily used with HTML
syntax-highlighting extensions for various popular code editors.
See also templateFrom.html, which returns a similar result but as an HTMLTemplateElement.
template From constant
A JavaScript template string literal that returns an HTML template.
Example:
const myTemplate = templateFrom.html`Hello, <em>world</em>.`
returns an HTMLTemplateElement
whose innerHTML
is Hello, <em>world</em>.
This function is called html
so that it can be easily used with HTML
syntax-highlighting extensions for various popular code editors.
See also html, a helper which returns a similar result but as an DocumentFragment.