A RetroSearch Logo

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

Search Query:

Showing content from https://developer.mozilla.org/ja/docs/Web/API/DOMImplementation/createDocument below:

DOMImplementation: createDocument() メソッド - Web API

DOMImplementation: createDocument() メソッド

Baseline Widely available

DOMImplementation.createDocument() メソッドは、 XMLDocument を作成して返します。

構文
createDocument(namespaceURI, qualifiedNameStr)
createDocument(namespaceURI, qualifiedNameStr, documentType)
引数
namespaceURI

作成する文書の名前空間 URI を格納した文字列です。文書が名前空間に属さない場合は null です。

qualifiedNameStr

作成する文書の修飾名(オプションで接頭辞とコロンにローカルルート要素名を加えたもの)を格納した文字列です。

documentType 省略可

作成する文書の DocumentType です。既定値は null です。

返値

なし (undefined)。

例
const doc = document.implementation.createDocument(
  "http://www.w3.org/1999/xhtml",
  "html",
  null,
);
const body = document.createElementNS("http://www.w3.org/1999/xhtml", "body");
body.setAttribute("id", "abc");
doc.documentElement.appendChild(body);
alert(doc.getElementById("abc")); // [object HTMLBodyElement]
仕様書 ブラウザーの互換性 関連情報

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