خاصية Meta name
مثال
قم بإرجاع قيمة سمة المحتوى لجميع عناصر التعريف:
var x = document.getElementsByTagName("META");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "Name of "+(i+1)+". meta tag: "+x[i].name+"<br>";
}
التعريف والاستخدام
تقوم خاصية الاسم بتعيين أو إرجاع اسم للمعلومات الموجودة في سمة المحتوى.
تعتمد قيمة سمة الاسم على قيمة سمة المحتوى.
هناك أيضًا قائمة موسعة محددة في WHATWG Wiki MetaExtensions Page - أي شخص حر في تحرير الصفحة في أي وقت لإضافة نوع جديد. لم يتم قبول أي منها رسميًا ، ولكن قد يتم قبولها في المستقبل. لمزيد من المعلومات ، قم بزيارة صفحة WHATWG Wiki MetaExtensions .
ملاحظة: إذا تم تعيين سمة http-equiv ، فلا يجب تعيين سمة الاسم.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
إرجاع خاصية الاسم:
metaObject.name
قم بتعيين خاصية الاسم:
metaObject.name = "application-name|author|description|generator|keywords"
Value | Description |
---|---|
application-name | Specifies the name of the Web application that the page represents |
author | Specifies the name of the author of the document. Example: <meta name="author" content="Hege Refsnes"> |
description | Specifies a description of the page. Search engines can pick up this description to show with the results of searches. Example: <meta name="description" content="Free web tutorials"> |
generator | Specifies one of the software packages used to generate the document (not used on hand-authored pages) Example: <meta name="generator" content="FrontPage 4.0"> |
keywords | Specifies a comma-separated list of keywords - relevant to the page (Informs search engines what the page is about). Tip: Always specify keywords (needed by search engines to catalogize the page). Example: <meta name="keywords" content="HTML, meta tag, tag reference"> |
قيمة الإرجاع
Type | Description |
---|---|
String | A name for the information in the content attribute |
❮ Meta Object