当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM hreflang属性

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM hreflang属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 421 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The hreflang property sets or returns the language code of the linked resource.
hreflang属性可设置或返回所链资源的语言代码。

Syntax
语法

anchorObject.hreflang=languagecode


Example
举例

The following example returns the language code of the linked resource:
下面举例中将返回所链资源的语言代码:

<html>
<body>
<p><a id="myAnchor" hreflang="us-en"
href="http://www.w3schools.com">W3Schools.com</a></p>
<script type="text/javascript">
x=document.getElementById("myAnchor");
document.write(x.hreflang);
</script>
</body>
</html>


演练

Get the language code of a linked resource
得到所链资源的语言代码

评论 (0) All

登陆 | 还没注册?