--- title: URL.host slug: Web/API/URL/host tags: - API - Property - Reference - URL - URL API translation_of: Web/API/URL/host --- <div>{{ApiRef("URL API")}}</div> <p>{{domxref("URL")}} 인터페이스의 <strong><code>host</code></strong> 속성은 URL의 호스트, 즉 {{domxref("URL.hostname", "hostname")}}와 함께, {{glossary("port", "포트")}}가 존재하는 경우 <code>':'</code>과 그 뒤의 {{domxref("URL.port", "port")}}를 포함하는 {{domxref("USVString")}} 문자열입니다.</p> <p>{{AvailableInWorkers}}</p> <h2 id="구문">구문</h2> <pre class="syntaxbox">const <em>host</em> = <em>url</em>.host <em>url.<code>host</code></em> = <em>newHost</em> </pre> <h3 id="값">값</h3> <p>{{domxref("USVString")}}.</p> <h2 id="예제">예제</h2> <pre class="brush: js">let url = new URL('https://developer.mozilla.org/ko/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" url = new URL('https://developer.mozilla.org:443/ko/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org" // The port number is not included because 443 is the scheme's default port url = new URL('https://developer.mozilla.org:4097/ko/docs/Web/API/URL/host'); console.log(url.host); // "developer.mozilla.org:4097"</pre> <h2 id="명세">명세</h2> <table class="standard-table"> <tbody> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> <tr> <td>{{SpecName('URL', '#dom-url-host', 'URL.host')}}</td> <td>{{Spec2('URL')}}</td> <td>Initial definition</td> </tr> </tbody> </table> <h2 id="브라우저_호환성">브라우저 호환성</h2> <p>{{Compat("api.URL.host")}}</p> <h2 id="같이_보기">같이 보기</h2> <ul> <li>속성이 속한 {{domxref("URL")}} 인터페이스.</li> </ul>