Get the latest tech news
<template>: The Content Template element
The <template> HTML element serves as a mechanism for holding HTML fragments, which can either be used later via JavaScript or generated immediately into shadow DOM.
Note: The HTML parser creates a ShadowRoot object in the DOM for the first<template> in a node with this attribute set to an allowed value. If the<template> element contains the shadowrootmode attribute with a value of either open or closed, the HTML parser will immediately generate a shadow DOM. Similarly, if there are multiple declarative shadow roots, only the first one is replaced by a ShadowRoot — subsequent instances are parsed as HTMLTemplateElement objects.
Or read this on Hacker News