A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement/content below:

HTMLTemplateElement: content property - Web APIs

MDN Web Docs
  1. References
  2. Web APIs
  3. HTMLTemplateElement
  4. content

Filter sidebar

In this article
  1. Web Components
  2. HTMLTemplateElement
  3. Instance properties
    1. content
    2. shadowRootClonable
    3. shadowRootDelegatesFocus
    4. shadowRootMode
    5. shadowRootSerializable
  4. Inheritance
    1. HTMLElement
    2. Element
    3. Node
    4. EventTarget
  5. Related pages for Web Components
    1. CustomElementRegistry
    2. CustomStateSet
    3. Document.createElement()
    4. Element.attachShadow()
    5. Element.shadowRoot
    6. Element.slot
    7. ElementInternals
    8. Event.composed
    9. Event.composedPath
    10. HTMLElement.attachInternals()
    11. HTMLSlotElement
    12. Node.getRootNode()
    13. Node.isConnected
    14. ShadowRoot
    15. Window.customElements
In this article HTMLTemplateElement: content property

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.

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

Value

A DocumentFragment.

Examples

js

const templateElement = document.querySelector("#foo");
const documentFragment = templateElement.content.cloneNode(true);
Specifications Specification HTML
# dom-template-content-dev
Browser compatibility See also Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on Apr 7, 2023 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3