blob: 6beb5b59a3949cf0efaa9a5ecd079388e8221f50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
---
title: Document.head
slug: Web/API/Document/head
tags:
- API
- Document
- HTML DOM
- Property
- Reference
translation_of: Web/API/Document/head
---
<div>{{APIRef("DOM")}}</div>
<p>{{domxref("Document")}} 인터페이스의 <strong><code>head</code></strong> 읽기 전용 속성은 현재 문서의 {{htmlelement("head")}} 요소를 나타냅니다.</p>
<h2 id="Example" name="Example">예제</h2>
<pre class="brush: html"><code><!doctype html>
<head id="my-document-head">
<title>Example: using document.head</title>
</head>
<script>
let theHead = document.head;
console.log(theHead.id); // "my-document-head";
console.log(theHead === document.querySelector("head")); // true
</script></code></pre>
<h2 id="Example" name="Example">참고</h2>
<p><code>Document.head</code>는 읽기 전용입니다. 값을 할당하려고 시도하면 조용히 실패하거나, <a href="/ko/docs/Web/JavaScript/Reference/Strict_mode">엄격 모드</a>에서는 {{jsxref("TypeError")}}가 발생합니다.</p>
<h2 id="명세">명세</h2>
<table class="spectable standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>Initial definition.</td>
</tr>
<tr>
<td>{{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}</td>
<td>{{Spec2('HTML5.1')}}</td>
<td> </td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("api.Document.head")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>{{domxref("document.body")}}</li>
</ul>
|