Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLTemplateElement

HTMLTemplateElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨November 2015⁩.

* Some parts of this feature may have varying levels of support.

TheHTMLTemplateElement interface enables access to the contents of an HTML<template> element.

Note:An HTML parser can create either anHTMLTemplateElement or aShadowRoot when it parses a<template> element, depending on the<template> attributes.If anHTMLTemplateElement is created the "shadow" attributes are reflected from the template.However these are not useful, because anHTMLTemplateElement is not a shadow root and cannot subsequently be changed to a shadow root.

EventTarget Node Element HTMLElement HTMLTemplateElement

Instance properties

This interface inherits the properties ofHTMLElement.

contentRead only

A read-onlyDocumentFragment which contains the DOM subtree representing the<template> element's template contents.

shadowRootMode

A string that reflects the value of theshadowrootmode attribute of the associated<template> element.

shadowRootDelegatesFocus

A boolean that reflects the value of theshadowrootdelegatesfocus attribute of the associated<template> element.

shadowRootClonable

A boolean that reflects the value of theshadowrootclonable attribute of the associated<template> element.

shadowRootSerializable

A boolean that reflects the value of theshadowrootserializable attribute of the associated<template> element.

Instance methods

This interface inherits the methods ofHTMLElement.

Specifications

Specification
HTML
# htmltemplateelement

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp