Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. DocumentFragment
  4. firstElementChild

DocumentFragment: firstElementChild property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.

TheDocumentFragment.firstElementChild read-only propertyreturns the document fragment's first childElement, ornull if thereare no child elements.

Value

AnElement that is the first childElement of the object, ornull if there are none.

Examples

js
let fragment = new DocumentFragment();fragment.firstElementChild; // nulllet paragraph = document.createElement("p");fragment.appendChild(paragraph);fragment.firstElementChild; // <p>

Specifications

Specification
DOM
# ref-for-dom-parentnode-firstelementchild①

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp