--- title: URL.hostname slug: Web/API/URL/hostname tags: - API - Property - Reference - URL - URL API translation_of: Web/API/URL/hostname ---
{{domxref("URL")}} 인터페이스의 hostname
속성은 URL의 {{glossary("domain name", "도메인 이름")}}을 담은 {{domxref("USVString")}}을 반환합니다.
{{AvailableInWorkers}}
const domain = url.hostname url.hostname = domain
{{domxref("USVString")}},
const url = new URL('https://developer.mozilla.org/ko/docs/Web/API/URL/hostname'); console.log(url.hostname); // Logs: 'developer.mozilla.org'
Specification | Status | Comment |
---|---|---|
{{SpecName('URL', '#dom-url-hostname', 'URL.hostname')}} | {{Spec2('URL')}} | Initial definition. |
{{Compat("api.URL.hostname")}}