HTML DOM type 属性
定义和用法
type 属性可设置或返回被链资源的 MIME 类型。
语法
- anchorObject.type=type
实例
下面的例子可返回被链资源的 MIME 类型:
- <html>
- <body>
- <p><a id="myAnchor" type="text/html"
- href="http://www.baidu.com">baidu.com</a></p>
- <script type="text/javascript">
- x=document.getElementById("myAnchor");
- document.write(
x.type
);- </script>
- </body>
- </html>