HTML DOM hreflang 属性

定义和用法

The hreflang property sets or returns the base language of the target URL.

语法

linkObject.hreflang=languagecode

实例

The following example returns the language code of the link element:

<html>
<head>
<link rel="stylesheet" type="text/css" 
hreflang="us-en" id="style1" href="try_dom_link.css" />
</head>
<body>

<script type="text/javascript">
x=document.getElementById("style1");
document.write("Language code=" + x.hreflang);
</script>

</body>
</html>

JS 参考手册

JavaScript

HTML DOM

Web API

HTML 对象

其他参考手册

目录