You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All methods `"getElementsBy*"` return a *live* collection. Such collections always reflect the current state of the document and "auto-update" when it changes.
278
+
.میشوند update را منعکس میکنند و وقتی تغییر میکند، به صورت خودکار document یک مجموعهی زنده برمیگردانند. چنین مجموعههایی همیشه وضعیت فعلی `"getElementsBy*"` تمام متدهای
279
279
280
-
In the example below, there are two scripts.
280
+
.داریم script در مثال زیر دو
281
+
282
+
283
+
.ایجاد میکند در حال حاضر طول آن `1` است `<div>` اولی ارجاعی به مجموعهی
284
+
285
+
دیگر را ببیند پس طول آن `2` است `<div>` زمانی اجرا میشود که مرورگر یک script دومین
281
286
282
-
1. The first one creates a reference to the collection of `<div>`. As of now, its length is `1`.
283
-
2. The second scripts runs after the browser meets one more `<div>`, so its length is `2`.
284
287
285
288
```html run
286
289
<div>First div</div>
@@ -299,9 +302,9 @@ In the example below, there are two scripts.
299
302
</script>
300
303
```
301
304
302
-
In contrast, `querySelectorAll` returns a *static* collection. It's like a fixed array of elements.
305
+
.ها استelement را برمیگرداند که شبیه یک آرایهی ثابت static یک مجموعهی `querySelectorAll` ،متقابلا
303
306
304
-
If we use it instead, then both scripts output `1`:
307
+
.خروجی `1` را میدهند script اگر به جایش از آن استفاده کنیم، هر دو
0 commit comments