HTML Attributes

HTML shadowrootserializable attribute

Marks a declaratively created shadow root as eligible for serialization when requested by supported DOM serialization APIs. It does not make ordinary innerHTML include shadow contents. Applicable elements include: <template>. Check each element’s value rules. Boolean syntax: presence enables the state; omit the attribute to disable it. A string value of "false" does not turn it off.

Formal Syntax & Structure

html syntaxhtml
shadowrootserializable

Parameters & Attributes

NameTypeDescription
shadowrootserializablebooleanMarks a declaratively created shadow root as eligible for serialization when requested by supported DOM serialization APIs. It does not make ordinary innerHTML include shadow contents.

Working Example

Example Snippethtml
<div>  <template shadowrootmode="open" shadowrootserializable>    <p>Shadow content</p>  </template></div>
HTML Reference