Skip to content

Commit 2a13786

Browse files
Update article.md
1 parent 490817e commit 2a13786

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • 2-ui/1-document/04-searching-elements-dom

2-ui/1-document/04-searching-elements-dom/article.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,12 @@ let divs = document.getElementsByTagName('div');
228228
</script>
229229
```
230230

231-
```warn header="Don't forget the `\"s\"` letter!"
232-
Novice developers sometimes forget the letter `"s"`. That is, they try to call `getElementByTagName` instead of <code>getElement<b>s</b>ByTagName</code>.
231+
```warn header="را فراموش نکنید. `\"s\"` عبارت"
233232

234-
The `"s"` letter is absent in `getElementById`, because it returns a single element. But `getElementsByTagName` returns a collection of elements, so there's `"s"` inside.
233+
برنامه‌نویس‌های تازه‌‌کار گاهی اوقات حرف ‍‍`"s"` را فراموش می‌کنند. یعنی، آن‌ها سعی می‌کنند به جای <code>getElement<b>s</b>ByTagName</code> عبارت `getElementByTagName` را فراخوانی کنند.
234+
235+
236+
حرف `"s"` در `getElementById` وجود ندارد زیرا یک element تک را برمی‌گرداند. اما `getElementsByTagName` مجموعه‌ای از عناصر را برمی‌گرداند،‌ پس یک `"s"` در آن هست.
235237
```
236238
237239
````warn header="It returns a collection, not an element!"

0 commit comments

Comments
 (0)