번역이 완료되지 않았습니다. Please help translate this article from English

DOMContentLoaded 이벤트는 초기 HTML 문서를 완전히 불러오고 분석했을 때 발생합니다. 스타일 시트, 이미지, 하위 프레임의 로딩은 기다리지 않습니다.

취소 가능 예 (although specified as a simple event that isn't cancelable)
인터페이스 Event
이벤트 처리기 속성 아니오

DOMContentLoaded의 원본 대상은 다 불러온 Document입니다. You can listen for this event on the Window interface to handle it in the capture or bubbling phases. For full details on this event please see the page on the Document: DOMContentLoaded event.

A different event, load, should be used only to detect a fully-loaded page. It is a common mistake to use load where DOMContentLoaded would be more appropriate.


Basic usage

window.addEventListener('DOMContentLoaded', (event) => {
    console.log('DOM fully loaded and parsed');


Specification Status
HTML Living Standard Living Standard

브라우저 호환성

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
DOMContentLoaded eventChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support 9Safari Full support 3.1WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 2Samsung Internet Android Full support 1.0


Full support  
Full support

같이 보기