HTML DOM 링크 객체
링크 개체
Link 개체는 HTML <link> 요소를 나타냅니다.
링크 개체에 액세스
getElementById()를 사용하여 <link> 요소에 액세스할 수 있습니다.
예시
var x = document.getElementById("myLink");
링크 개체 만들기
document.createElement() 메서드를 사용하여 <link> 요소를 만들 수 있습니다.
예시
var x = document.createElement("LINK");
링크 개체 속성
Property | Description |
---|---|
charset | Not supported in HTML5. Sets or returns the character encoding of the linked document |
crossOrigin | Sets or returns the the CORS settings of the linked document |
disabled | Sets or returns whether the linked document is disabled, or not |
href | Sets or returns the URL of the linked document |
hreflang | Sets or returns the language code of the linked document |
media | Sets or returns the media type for the link element |
rel | Sets or returns the relationship between the current document and the linked document |
rev | Not supported in HTML5. Sets or returns the reverse relationship from the linked document to the current document |
sizes | Returns the value of the sizes attribute of the linked resource |
type | Sets or returns the content type of the linked document |
표준 속성 및 이벤트
Link 개체는 표준 속성 과 이벤트 도 지원합니다 .
관련 페이지
HTML 참조: HTML <link> 태그