Anchor hreflang attribute

Definition and Usage

hreflang attribute sets or returns the hreflang attribute value.

hreflang The attribute specifies the language of the linked document.

Tip:To view all available language codes, please visit ourLanguage Code Reference Manual.

Example

Example 1

Get the language code of the link:

var x = document.getElementById("myAnchor").hreflang;

Try it yourself

Example 2

Change the language code of the link:

document.getElementById("myAnchor").hreflang = "fr";

Try it yourself

Syntax

Return hreflang attribute:

anchorObject.hreflang

set hreflang attribute:

anchorObject.hreflang = languagecode

خصوصیت کا مقدار

مقدار وصف
languagecode دو حرفی زبانی کد، جو لینک کی دکھائی دی جانے والی کاغذ کی زبان کا نشان دہی کرتا ہے۔

تکنیکی تفصیلات

بازگشتی کار اس کا مراد، لینک کا دکھائی دی جانے والا زبان کا بيان ہوتا ہے۔

بrowsers کی پشتیبندگی

کروم ایج فائرفاکس سافری آپریا
کروم ایج فائرفاکس سافری آپریا
پشتیبندگی پشتیبندگی پشتیبندگی پشتیبندگی پشتیبندگی

مرتبط صفحات

HTML مرجع دسانی:HTML <a> hreflang اپرائز