A RetroSearch Logo

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

Search Query:

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

HTMLTemplateElement.content - Web API | MDN

MDN Web Docs
  1. 面向开发者的 Web 技术
  2. Web API
  3. HTMLTemplateElement
  4. HTMLTemplateElement.content

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

Filter sidebar

在本文中
  1. Web Component
  2. HTMLTemplateElement
  3. 实例属性
    1. content
    2. shadowRootClonable
    3. shadowRootDelegatesFocus
    4. shadowRootMode
    5. shadowRootSerializable
  4. 继承
    1. HTMLElement
    2. Element
    3. Node
    4. EventTarget
  5. 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
在本文中 HTMLTemplateElement.content

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.

HTMLTemplateElement.content 属性返回 <template> 元素的模板内容(一个 DocumentFragment)。

语法
var documentFragment = templateElement.content
示例

js

var templateElement = document.querySelector("#foo");
var documentFragment = templateElement.content.cloneNode(true);
规范 Specification HTML
# dom-template-content-dev
浏览器兼容性 相关链接 Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on 2023年4月21日 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.4