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 1IE Full support 4Opera Full support 3Safari Full support 1WebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 1Samsung Internet Android Full support 1.0

Legend

Full support  
Full support

같이 보기