Document.head 읽기전용 속성은 현재 문서의 <head> 요소를 나타냅니다.

예제

<!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>

참고

Document.head는 읽기 전용입니다. 값을 할당하려고 시도하면 조용히 실패하거나, 엄격 모드에서는 TypeError가 발생합니다.

명세

Specification Status Comment
HTML Living Standard
The definition of 'Document.head' in that specification.
Living Standard Initial definition.
HTML 5.1
The definition of 'Document.head' in that specification.
Recommendation  
HTML5
The definition of 'Document.head' in that specification.
Recommendation  

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 4IE Full support 9Opera Full support 11Safari Full support 5WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

같이 보기

 

문서 태그 및 공헌자

이 페이지의 공헌자: urty5656, dragmove
최종 변경자: urty5656,