Skip to content

Commit c883271

Browse files
chore: translate Searching: getElement*, querySelector* article
Searching: getElement*, querySelector*
2 parents 8fb2fe9 + d7b7698 commit c883271

File tree

4 files changed

+137
-141
lines changed

4 files changed

+137
-141
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
1-
There are many ways to do it.
21

3-
Here are some of them:
2+
Existem muitas maneiras de fazer isso.
3+
4+
Aqui estão algumas delas:
45

56
```js
6-
// 1. The table with `id="age-table"`.
7+
// 1. A tabela com `id="age-table"`.
78
let table = document.getElementById('age-table')
89

9-
// 2. All label elements inside that table
10+
// 2. Todos os elementos label dentro dessa tabela
1011
table.getElementsByTagName('label')
11-
// or
12+
// ou
1213
document.querySelectorAll('#age-table label')
1314

14-
// 3. The first td in that table (with the word "Age")
15+
// 3. O primeiro td nessa tabela (com a palavra "Idade")
1516
table.rows[0].cells[0]
16-
// or
17+
// ou
1718
table.getElementsByTagName('td')[0]
18-
// or
19+
// ou
1920
table.querySelector('td')
2021

21-
// 4. The form with the name "search"
22-
// assuming there's only one element with name="search" in the document
22+
// 4. O formulário com o nome "search"
23+
// assumindo que existe apenas um elemento com name="search" no documento
2324
let form = document.getElementsByName('search')[0]
24-
// or, form specifically
25+
// ou, especificamente, o formulário
2526
document.querySelector('form[name="search"]')
2627

27-
// 5. The first input in that form.
28+
// 5. O primeiro input nesse formulário.
2829
form.getElementsByTagName('input')[0]
29-
// or
30+
// ou
3031
form.querySelector('input')
3132

32-
// 6. The last input in that form
33+
// 6. O último input nesse formulário
3334
let inputs = form.querySelectorAll('input') // find all inputs
3435
inputs[inputs.length-1] // take the last one
3536
```

Diff for: 2-ui/1-document/04-searching-elements-dom/1-find-elements/table.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<body>
44
<form name="search">
5-
<label>Search the site:
5+
<label>Pesquise o local:
66
<input type="text" name="search">
77
</label>
88
<input type="submit" value="Search!">
@@ -11,22 +11,22 @@
1111
<hr>
1212

1313
<form name="search-person">
14-
Search the visitors:
14+
Pesquise os visitantes:
1515
<table id="age-table">
1616
<tr>
17-
<td>Age:</td>
17+
<td>Idade:</td>
1818
<td id="age-list">
1919
<label>
20-
<input type="radio" name="age" value="young">less than 18</label>
20+
<input type="radio" name="age" value="young">menos de 18</label>
2121
<label>
22-
<input type="radio" name="age" value="mature">18-50</label>
22+
<input type="radio" name="age" value="mature">entre 18 e 50</label>
2323
<label>
24-
<input type="radio" name="age" value="senior">more than 50</label>
24+
<input type="radio" name="age" value="senior">mais de 50</label>
2525
</td>
2626
</tr>
2727

2828
<tr>
29-
<td>Additionally:</td>
29+
<td>Adicionalmente:</td>
3030
<td>
3131
<input type="text" name="info[0]">
3232
<input type="text" name="info[1]">

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+
# Procurar por elementos
66

7-
Here's the document with the table and form.
7+
Aqui está o documento com a tabela e o formulário.
88

9-
How to find?...
9+
Como encontrar?...
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. A tabela com `id="age-table"`.
12+
2. Todos os elementos `label` dentro dessa tabela (deveriam ser 3 deles).
13+
3. O primeiro `td` nessa tabela (com a palavra "Idade").
14+
4. O `form` com `name="search"`.
15+
5. O primeiro `input` nesse formulário.
16+
6. O último `input` nesse formulário.
1717

18-
Open the page [table.html](table.html) in a separate window and make use of browser tools for that.
18+
Abra a página [table.html](table.html) em uma janela separada e use as ferramentas do navegador para isso.

0 commit comments

Comments
 (0)