Skip to content

Commit e8db105

Browse files
authoredMay 17, 2023
Merge pull request #189 from msisaifu/dom-navigation
Walking the DOM
2 parents 13f763b + 4fe4aa6 commit e8db105

File tree

7 files changed

+124
-124
lines changed

7 files changed

+124
-124
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
There are many ways, for instance:
1+
অনেকভাবে এটি করা যায়, যেমন:
22

33

4-
The `<div>` DOM node:
4+
`<div>` DOM নোড:
55

66
```js
77
document.body.firstElementChild
8-
// or
8+
// অথবা
99
document.body.children[0]
10-
// or (the first node is space, so we take 2nd)
10+
// অথবা (প্রথম নোডটি স্পেস হতে পারে, আমরা 2য়টি নিব)
1111
document.body.childNodes[1]
1212
```
1313

14-
The `<ul>` DOM node:
14+
`<ul>` DOM নোড:
1515

1616
```js
1717
document.body.lastElementChild
18-
// or
18+
// অথবা
1919
document.body.children[1]
2020
```
2121

22-
The second `<li>` (with Pete):
22+
দ্বিতীয় `<li>` (Pete টেক্সট সহ):
2323

2424
```js
25-
// get <ul>, and then get its last element child
25+
// প্রথমে <ul>, এবং তারপর শেষ চাইল্ড এলিমেন্ট
2626
document.body.lastElementChild.lastElementChild
2727
```

Diff for: ‎2-ui/1-document/03-dom-navigation/1-dom-children/task.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# DOM children
5+
# DOM চিলড্রেন
66

7-
Look at this page:
7+
এটি দেখুন:
88

99
```html
1010
<html>
@@ -18,7 +18,7 @@ Look at this page:
1818
</html>
1919
```
2020

21-
For each of the following, give at least one way of how to access them:
22-
- The `<div>` DOM node?
23-
- The `<ul>` DOM node?
24-
- The second `<li>` (with Pete)?
21+
নিম্নোক্ত প্রতিটি এলিমেন্ট সমূহ কিভাবে অ্যাক্সেস করা যায়?
22+
- `<div>` DOM নোড?
23+
- `<ul>` DOM নোড?
24+
- দ্বিতীয় `<li>` (Pete টেক্সট সহ)?
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
1. Yes, true. The element `elem.lastChild` is always the last one, it has no `nextSibling`.
2-
2. No, wrong, because `elem.children[0]` is the first child *among elements*. But there may exist non-element nodes before it. So `previousSibling` may be a text node.
1+
1. হ্যাঁ, সত্য। `elem.lastChild` সর্বদা শেষটি হবে, এটির কোন `nextSibling` নেই।
2+
2. না, ভুল, কেননা `elem.children[0]` হবে *সকল এলিমেন্টের* মধ্যে প্রথম চাইল্ড। কিন্তু পূর্বে নন-এলিমেন্ট নোডও থাকতে পারে. সুতরাং `previousSibling` টেক্সট নোডও হতে পারে।
33

4-
Please note: for both cases if there are no children, then there will be an error.
4+
দয়া করে মনে রাখুন: উভয়ই ক্ষেত্রে কোন চিলড্রেন না থাকলে, এরোর হবে।
55

6-
If there are no children, `elem.lastChild` is `null`, so we can't access `elem.lastChild.nextSibling`. And the collection `elem.children` is empty (like an empty array `[]`).
6+
যদি কোন চিলড্রেন না থাকে, `elem.lastChild` হবে `null`, সুতরাং আমরা এভাবে লিখতে পারব না `elem.lastChild.nextSibling`। এবং `elem.children` কালেকশনটি হবে খালি (অনেকটা খালি অ্যারের মত `[]`)

Diff for: ‎2-ui/1-document/03-dom-navigation/3-navigation-links-which-null/task.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# The sibling question
5+
# sibling নিয়ে প্রশ্ন
66

7-
If `elem` -- is an arbitrary DOM element node...
7+
`elem` -- কি আরবিট্ররি DOM এলিমেন্ট নোড হবে?...
88

9-
- Is it true that `elem.lastChild.nextSibling` is always `null`?
10-
- Is it true that `elem.children[0].previousSibling` is always `null` ?
9+
- `elem.lastChild.nextSibling` সর্বদা `null` এটি কি সত্য?
10+
- `elem.children[0].previousSibling` সর্বদা `null` এটি কি সত্য?
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
We'll be using `rows` and `cells` properties to access diagonal table cells.
1+
আমরা `rows` এবং `cells` প্রপার্টি দ্বারা কোণাকুণি *td* সমূহকে সিলেক্ট করতে পারি।

Diff for: ‎2-ui/1-document/03-dom-navigation/4-select-diagonal-cells/task.md

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

33
---
44

5-
# Select all diagonal cells
5+
# কোণাকুণি সকল td কে সিলেক্ট করুন
66

7-
Write the code to paint all diagonal table cells in red.
7+
কোণাকুণি সকল td এর ব্যকগ্রাউন্ড লাল করার কোড লিখুন।
88

9-
You'll need to get all diagonal `<td>` from the `<table>` and paint them using the code:
9+
প্রথমে আপনাকে `<table>` এর সকল কোণাকুণি `<td>` কে সিলেক্ট করতে হবে তারপর তাদের ব্যাকগ্রাউন্ড পরিবর্তন করবেন:
1010

1111
```js
1212
// td should be the reference to the table cell
1313
td.style.backgroundColor = 'red';
1414
```
1515

16-
The result should be:
16+
আউটপুট হবে এমন:
1717

1818
[iframe src="solution" height=180]

0 commit comments

Comments
 (0)