Document.URL

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

예제

JavaScript

js

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

HTML

html

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

결과

명세

Specification
DOM Standard
# ref-for-dom-document-url①

브라우저 호환성

BCD tables only load in the browser

같이 보기