Latest web development tutorials

HTML DOM 앵커 type 속성

앵커 객체 참조 앵커 객체

정의 및 사용

속성 세트를 입력하거나 자원 체인의 MIME 타입을 돌려줍니다.

유형 속성은 링크 된 문서의 MIME 유형을 설명한다.

문법

경화형 속성 :

anchorObject.type="MIME-type"

반환 속성을 입력합니다 :

anchorObject.type

描述
MIME-type 描述链接文档的 MIME 类型。 更多关于 MIME 类型请查看 IANA MIME types


브라우저 지원

Internet ExplorerFirefoxOperaGoogle ChromeSafari

모든 주요 브라우저 유형 속성 지원


다음은 링크 자원의 MIME 타입을 리턴

<html>
<body>

<p><a id="w3s" type="text/html"
href="http://www.w3cschool.cc">W3Schools</a></p>

<script>
document.write(document.getElementById("w3s").type);
</script>

</body>
</html>

위의 출력의 예 :

text/html

»시도


앵커 객체 참조 앵커 객체