From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/document/head/index.html | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 files/ja/web/api/document/head/index.html (limited to 'files/ja/web/api/document/head/index.html') diff --git a/files/ja/web/api/document/head/index.html b/files/ja/web/api/document/head/index.html new file mode 100644 index 0000000000..1916b0964b --- /dev/null +++ b/files/ja/web/api/document/head/index.html @@ -0,0 +1,84 @@ +--- +title: Document.head +slug: Web/API/Document/head +tags: + - API + - Document + - HTML DOM + - Reference + - head +translation_of: Web/API/Document/head +--- +
{{APIRef("DOM")}}
+ +

{{domxref("Document")}} インターフェイスの head は読み取り専用のプロパティで、現在の文書の {{HTMLElement("head")}} 要素を返します。

+ +

構文

+ +
var objRef = document.head;
+
+ +

+ +

{{domxref("HTMLHeadElement")}} です。

+ +

+ +
<!doctype html>
+<head id="my-document-head">
+  <title>Example: using document.head</title>
+</head>
+
+<script>
+  var theHead = document.head;
+
+  console.log(theHead.id); // "my-document-head";
+
+  console.log( theHead === document.querySelector("head") ); // true
+</script>
+
+ +

メモ

+ +

document.head は読取専用です。このプロパティに値を代入した場合は、暗黙に失敗するか、 Strict モードの場合は、 {{jsxref("TypeError")}} を投げます。

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML5.1')}} 
{{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの対応

+ + + +
{{Compat("api.Document.head")}}
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf