Skip to content

Commit e881874

Browse files
committed
translate Searching: getElement*, querySelector*
1 parent 05c61d9 commit e881874

File tree

3 files changed

+104
-108
lines changed

3 files changed

+104
-108
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
There are many ways to do it.
1+
Ada banyak cara untuk melakukan ini.
22

3-
Here are some of them:
3+
Ini adalah salah satu caranya:
44

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

9-
// 2. All label elements inside that table
9+
// 2. All label elements inside that table (2. Semua elemen label di dalam tabel).
1010
table.getElementsByTagName('label')
11-
// or
11+
// or
1212
document.querySelectorAll('#age-table label')
1313

14-
// 3. The first td in that table (with the word "Age")
14+
// 3. The first td in that table (with the word "Age") (3. elemen td pertama pada tabel (dengan kata "Age")).
1515
table.rows[0].cells[0]
1616
// or
1717
table.getElementsByTagName('td')[0]
1818
// or
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. The form with the name "search" (Formulir dengan nama "search").
22+
// assuming there's only one element with name="search" in the document (mengasumsikan hanya ada satu elemen dengan nama="search" di dalam dokumen).
2323
let form = document.getElementsByName('search')[0]
24-
// or, form specifically
24+
// or, form specifically (atau, khususnya formulir).
2525
document.querySelector('form[name="search"]')
2626

27-
// 5. The first input in that form.
27+
// 5. The first input in that form (elemen input pertama pada formulir).
2828
form.getElementsByTagName('input')[0]
2929
// or
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. The last input in that form (elemen input terakhir pada formulir).
33+
let inputs = form.querySelectorAll('input') // find all inputs (mencari semua elemen input).
34+
inputs[inputs.length-1] // take the last one (mengambil elemen input terakhir).
3535
```

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ importance: 4
22

33
---
44

5-
# Search for elements
5+
# Pencarian untuk elemen
66

7-
Here's the document with the table and form.
7+
Ini adalah dokumen dengan tabel dan formulir.
88

9-
How to find?...
9+
Bagaimana cara mencari?...
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. Tabel dengan `id="age-table"`.
12+
2. Semua elemen `label` di dalam tabel (seharusnya ada 3).
13+
3. `td` pertama di dalam tabel (dengan kata "Age").
14+
4. `form` dengan `name="search"`.
15+
5. `input` pertama dalam formulir.
16+
6. `input` terakhir di dalam formulir.
1717

18-
Open the page [table.html](table.html) in a separate window and make use of browser tools for that.
18+
Bukalah halaman [table.html](table.html) di dalam jendela yang berbeda dan gunakan alat browser untuk itu.

0 commit comments

Comments
 (0)