الجدول tBodies مجموعة
مثال
اكتشف عدد عناصر <tbody> الموجودة في الجدول:
var x = document.getElementById("myTable").tBodies.length;
ستكون نتيجة x :
2
المزيد من الأمثلة "جربها بنفسك" أدناه.
التعريف والاستخدام
ترجع مجموعة tBodies مجموعة من كل عناصر <tbody> في جدول.
ملاحظة: يتم فرز العناصر الموجودة في المجموعة كما تظهر في التعليمات البرمجية المصدر.
دعم المتصفح
Collection | |||||
---|---|---|---|---|---|
tBodies | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
tableObject.tBodies
الخصائص
Property | Description |
---|---|
length | Returns the number of <tbody> elements in the collection. Note: This property is read-only |
طرق
Method | Description |
---|---|
[index] | Returns the <tbody> element from the collection with the specified index (starts at 0). Note: Returns null if the index number is out of range |
item(index) | Returns the <tbody> element from the collection with the specified index (starts at 0). Note: Returns null if the index number is out of range |
namedItem(id) | Returns the <tbody> element from the collection with the specified id. Note: Returns null if the id does not exist |
تفاصيل تقنية
إصدار DOM: | كائن مستند المستوى 2 الأساسي |
---|---|
قيمة الإرجاع: | كائن HTMLCollection ، يمثل جميع عناصر <tbody> في عنصر <table>. يتم فرز العناصر الموجودة في المجموعة كما تظهر في التعليمات البرمجية المصدر |
مزيد من الأمثلة
مثال
[ فهرس ]
تنبيه HTML الداخلي لعنصر <tbody> الأول (الفهرس 0) في الجدول:
alert(document.getElementById("myTable").tBodies[0].innerHTML;
مثال
عنصر ( فهرس )
تنبيه HTML الداخلي لعنصر <tbody> الأول (الفهرس 0) في الجدول:
alert(document.getElementById("myTable").tBodies.item(0).innerHTML);
مثال
العنصر ( المعرف )
تنبيه HTML الداخلي للعنصر <tbody> بالمعرف = "myTBody" في الجدول:
alert(document.getElementById("myTable").tBodies.namedItem("myTBody").innerHTML);
الصفحات ذات الصلة
مرجع HTML: علامة HTML <tbody>
❮ كائن الجدول