Document.URL

Document 인터페이스의 URL 읽기 전용 속성은 문서의 주소를 문자열로 반환합니다.

예제

JavaScript

document.getElementById("url").textContent = document.URL;

HTML

<p id="urlText">
  URL:<br/>
  <span id="url">URL이 여기 보입니다</span>
</p>

결과

명세

Specification Status Comment
DOM
The definition of 'Document.URL' in that specification.
Living Standard Defines that the property is a USVString instead of a DOMString.
Document Object Model (DOM) Level 1 Specification
The definition of 'Document.URL' in that specification.
Obsolete Initial definition

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
URLChrome Full support 1Edge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

같이 보기