diff options
Diffstat (limited to 'files/ar/web/api/domtokenlist/length/index.html')
-rw-r--r-- | files/ar/web/api/domtokenlist/length/index.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/ar/web/api/domtokenlist/length/index.html b/files/ar/web/api/domtokenlist/length/index.html new file mode 100644 index 0000000000..c65f931027 --- /dev/null +++ b/files/ar/web/api/domtokenlist/length/index.html @@ -0,0 +1,62 @@ +--- +title: DOMTokenList.length +slug: Web/API/DOMTokenList/length +translation_of: Web/API/DOMTokenList/length +--- +<p>{{APIRef("DOM")}}</p> + +<p>The <code><strong>length</strong></code> read-only property of the {{domxref("DOMTokenList")}} interface is an <code>integer</code> representing the number of objects stored in the object.</p> + +<h2 id="بنية_الجملة">بنية الجملة</h2> + +<pre class="syntaxbox">tokenList.length;</pre> + +<h3 id="القيمة_العائدة">القيمة العائدة</h3> + +<p>تُعيد <code>رقم صحيح</code>.</p> + +<h2 id="أمثلة">أمثلة</h2> + +<p>في المثال التالي نقوم بإسترداد قيمة الـ classes الموضوعة داخل {{htmlelement("span")}} element as a <code>DOMTokenList</code> using {{domxref("Element.classList")}}, then write the length of the list to the <code><span></code>'s {{domxref("Node.textContent")}}.</p> + +<p>أولاً، الـ HTML:</p> + +<pre class="brush: html"><span class="a b c"></span></pre> + +<p>الآن الـ JavaScript:</p> + +<pre class="brush: js">var span = document.querySelector("span"); +var classes = span.classList; +var length = classes.length; + +span.textContent = 'classList length = ' + length; +</pre> + +<p>نتيجة الكود ستكون بالشكل التالي:</p> + +<p>{{ EmbedLiveSample('Examples', '100%', 60) }}</p> + +<h2 id="الخصائص">الخصائص</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('DOM WHATWG','#dom-domtokenlist-length','length')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="دعم_المتصفحات">دعم المتصفحات</h2> + +<div> + + +<p>{{Compat("api.DOMTokenList.length")}}</p> +</div> |