Skip to content

Commit 21656e0

Browse files
authored
Merge pull request #188 from msisaifu/searching-elements-dom
Searching: getElement*, querySelector*
2 parents e8db105 + 98b5352 commit 21656e0

File tree

3 files changed

+106
-106
lines changed

3 files changed

+106
-106
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
There are many ways to do it.
1+
এটি অনেকভাবে করা যায়।
22

3-
Here are some of them:
3+
এখানে দেখুন:
44

55
```js
66
// 1. The table with `id="age-table"`.
77
let table = document.getElementById('age-table')
88

9-
// 2. All label elements inside that table
9+
// 2. table এর মধ্যে সকল `label` এলিমেন্ট
1010
table.getElementsByTagName('label')
11-
// or
11+
// বা
1212
document.querySelectorAll('#age-table label')
1313

14-
// 3. The first td in that table (with the word "Age")
14+
// 3. *table* এর প্রথম `td` (with the word "Age")
1515
table.rows[0].cells[0]
16-
// or
16+
// বা
1717
table.getElementsByTagName('td')[0]
18-
// or
18+
// বা
1919
table.querySelector('td')
2020

21-
// 4. The form with the name "search"
22-
// assuming there's only one element with name="search" in the document
21+
// 4. `form` এলিমেন্ট যার `name="search"`
22+
// ধরে নিন DOM এ একটি মাত্র name="search" এলিমেন্ট আছে
2323
let form = document.getElementsByName('search')[0]
24-
// or, form specifically
24+
// বা,
2525
document.querySelector('form[name="search"]')
2626

27-
// 5. The first input in that form.
27+
// 5. `form` এর প্রথম `input` এলিমেন্ট.
2828
form.getElementsByTagName('input')[0]
29-
// or
29+
// বা
3030
form.querySelector('input')
3131

32-
// 6. The last input in that form
33-
let inputs = form.querySelectorAll('input') // find all inputs
34-
inputs[inputs.length-1] // take the last one
32+
// 6. `form` এর শেষ `input` এলিমেন্ট
33+
let inputs = form.querySelectorAll('input') // সকল ইনপুট
34+
inputs[inputs.length-1] // শেষ এলিমেন্টটি নেয়া
3535
```

Diff for: 2-ui/1-document/04-searching-elements-dom/1-find-elements/task.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ importance: 4
22

33
---
44

5-
# Search for elements
5+
# এলিমেন্টের অনুসন্ধান
66

7-
Here's the document with the table and form.
7+
এখানে table এবং form দ্বারা ডকুমেন্টটি।
88

9-
How to find?...
9+
কিভাবে খুঁজবেন?...
1010

11-
1. The table with `id="age-table"`.
12-
2. All `label` elements inside that table (there should be 3 of them).
13-
3. The first `td` in that table (with the word "Age").
14-
4. The `form` with `name="search"`.
15-
5. The first `input` in that form.
16-
6. The last `input` in that form.
11+
1. *table* এর id `id="age-table"`
12+
2. *table* এর মধ্যে সকল `label` এলিমেন্ট(৩টি এলিমেন্ট আছে)।
13+
3. *table* এর প্রথম `td` (যার কন্টেন্ট "Age")
14+
4. `form` এলিমেন্ট যার `name="search"`
15+
5. `form` এর প্রথম `input` এলিমেন্ট।
16+
6. `form` এর শেষ `input` এলিমেন্ট।
1717

18-
Open the page [table.html](table.html) in a separate window and make use of browser tools for that.
18+
এই পেজটি আলাদা উইন্ডোতে খুলুন [table.html](table.html) এবং ডেভ টুলসের সাহায্যে যাচাইগুলো চালান।

0 commit comments

Comments
 (0)