Table of Contents

Class HTMLTemplateElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLTemplateElement interface enables access to the contents of an HTML template element.

[Value("HTMLTemplateElement")]
public class HTMLTemplateElement : HTMLElement
Inheritance
HTMLTemplateElement
Inherited Members

Remarks

NOTE

An HTML parser can create either an HTMLTemplateElement or a ShadowRoot when it parses a {{HTMLElement("template")}} element, depending on the <template> attributes.
If an HTMLTemplateElement is created the "shadow" attributes are reflected from the template.
However these are not useful, because an HTMLTemplateElement is not a shadow root and cannot subsequently be changed to a shadow root.

See also on MDN

Constructors

HTMLTemplateElement()

public HTMLTemplateElement()

Properties

Content

The HTMLTemplateElement.content property returns a
<template> element's template contents (a
DocumentFragment).

[Value("content")]
public DocumentFragment Content { get; }

Property Value

DocumentFragment

A DocumentFragment.

Remarks

ShadowRootClonable

The shadowRootClonable property reflects the value of the shadowrootclonable attribute of the associated <template> element.

[Value("shadowRootClonable")]
public bool ShadowRootClonable { get; set; }

Property Value

bool

Reflects the value of the shadowrootclonable attribute of the associated <template> element.

Remarks

Note that this property is not useful for developers.
If a <template> element is used to declaratively create a ShadowRoot, then this object and property do not exist.
Otherwise, if an HTMLTemplateElement is created, the value of this property is irrelevant because the object is not a shadow root and cannot subsequently be changed to a shadow root.

-shadowrootclonable attribute of the <template> element
-ShadowRoot.clonable

See also on MDN

ShadowRootDelegatesFocus

The shadowRootDelegatesFocus property of the HTMLTemplateElement interface reflects the value of the shadowrootdelegatesfocus attribute of the associated <template> element.

[Value("shadowRootDelegatesFocus")]
public bool ShadowRootDelegatesFocus { get; set; }

Property Value

bool

Reflects the value of the shadowrootdelegatesfocus attribute of the associated <template> element.

Remarks

Note that this property is not useful for developers.
If a <template> element is used to declaratively create a ShadowRoot, then this object and property do not exist.
Otherwise, if an HTMLTemplateElement is created, the value of this property is irrelevant because the object is not a shadow root and cannot subsequently be changed to a shadow root.

-shadowrootdelegatesfocus attribute of the <template> element
-ShadowRoot.delegatesFocus

See also on MDN

ShadowRootMode

The shadowRootMode property of the HTMLTemplateElement interface reflects the value of the shadowrootmode attribute of the associated <template> element.

[Value("shadowRootMode")]
public string ShadowRootMode { get; set; }

Property Value

string

Reflects the value of the shadowrootmode attribute of the associated <template> element.

Remarks

Note that this property is not useful for developers.
If a <template> element is used to declaratively create a ShadowRoot, then this object and property do not exist.
Otherwise, if an HTMLTemplateElement is created, the value of this property is irrelevant because the object is not a shadow root and cannot subsequently be changed to a shadow root.

-shadowrootmode attribute of the <template> element
-ShadowRoot.mode

See also on MDN

ShadowRootSerializable

The shadowRootSerializable property reflects the value of the shadowrootserializable attribute of the associated <template> element.

[Value("shadowRootSerializable")]
public bool ShadowRootSerializable { get; set; }

Property Value

bool

Reflects the value of the shadowrootserializable attribute of the associated <template> element.

Remarks

Note that this property is not useful for developers.
If a <template> element is used to declaratively create a ShadowRoot, then this object and property do not exist.
Otherwise, if an HTMLTemplateElement is created, the value of this property is irrelevant because the object is not a shadow root and cannot subsequently be changed to a shadow root.

-shadowrootserializable attribute of the <template> element
-ShadowRoot.serializable

See also on MDN