JavaScript Reference/Javascript Properties/hreflang

Материал из Web эксперт
Перейти к: навигация, поиск

"hreflang" Example

    
<html>
<head>
<base id="myBase">
</head>
<body>
<a id="myAnchor" href="/index.htm" hreflang="en">www.wbex.ru site</a> 
<br>
<br>
<button onclick="alert(myAnchor.hreflang);">Language</button>
</body>
</html>



"hreflang" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <link>                        |
+----------------+--------------------------------------------------------------+



"hreflang" Syntax and Note

Note:
Read and write property. 
Sets the written language code for href destination.
    
Syntax:
    
document.getElementById("elementID").hreflang = value
document.all.elementID.hreflang = value // IE only