خاصية مرساة الهدف
مثال
غيّر هدف الارتباط إلى "_blank" (سيتم فتح الرابط في نافذة جديدة):
document.getElementById("myAnchor").target = "_blank";
التعريف والاستخدام
تقوم الخاصية الهدف بتعيين أو إرجاع قيمة السمة الهدف للارتباط.
تحدد السمة الهدف مكان فتح المستند المرتبط.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
target | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
إعادة الخاصية الهدف:
anchorObject.target
قم بتعيين الخاصية الهدف:
anchorObject.target = "_blank|_self|_parent|_top|framename"
قيم الملكية
Value | Description |
---|---|
_blank | Opens the linked document in a new window |
_self | Opens the linked document in the same frame as it was clicked (this is default) |
_parent | Opens the linked document in the parent frameset |
_top | Opens the linked document in the full body of the window |
framename | Opens the linked document in a named frame |
تفاصيل تقنية
قيمة الإرجاع: | سلسلة ، تمثل مكان فتح المستند المرتبط |
---|
مزيد من الأمثلة
مثال
إرجاع قيمة السمة الهدف للارتباط:
var x =
document.getElementById("myAnchor").target;
الصفحات ذات الصلة
مرجع HTML: سمة هدف HTML <a>
❮ مرساة الكائن