- Notifications
You must be signed in to change notification settings - Fork230
Searching: getElement*, querySelector*#311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
joaquinelio merged 19 commits intojavascript-tutorial:masterfromelemarmar:search-elements-dom-emmJul 21, 2020
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
19 commits Select commitHold shift + click to select a range
ce7cadc Update article.md
elemarmar62f1599 Update article.md
elemarmarddc5556 Update article.md
elemarmar0781af4 Update solution.md
elemarmar81db12d Update task.md
elemarmarba2e0a6 Update solution.md
elemarmar2a86f2f Update table.html
elemarmarc236fc5 Update article.md
elemarmar29d49ac Update article.md
elemarmar8aeac8a Update solution.md
elemarmarc549aae Update table.html
elemarmarc61abd1 Update article.md
elemarmarf22b840 Update 2-ui/1-document/04-searching-elements-dom/1-find-elements/solu…
elemarmar1f3fb3a Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmare9b1d5e Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmar8c570c5 Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmar5edbfd0 Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmar269b5fa Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmaree7670b Update 2-ui/1-document/04-searching-elements-dom/article.md
elemarmarFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
26 changes: 13 additions & 13 deletions2-ui/1-document/04-searching-elements-dom/1-find-elements/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,35 @@ | ||
| Hay muchas maneras de resolverlo. | ||
| Aquí hay algunas de ellas: | ||
| ```js | ||
| // 1.La tabla con `id="age-table"`. | ||
| let table = document.getElementById('age-table') | ||
| // 2.Todos los elementos `label` dentro de esa tabla | ||
| table.getElementsByTagName('label') | ||
| // or | ||
| document.querySelectorAll('#age-table label') | ||
| // 3.El primer `td` en la tabla (con la palabra "Age") | ||
| table.rows[0].cells[0] | ||
| // or | ||
| table.getElementsByTagName('td')[0] | ||
| // or | ||
| table.querySelector('td') | ||
| // 4.El `form` conname="search" | ||
| //suponiendo que sólo hay un elemento conname="search"en el documento | ||
| let form = document.getElementsByName('search')[0] | ||
| //o, utilizando elformespecíficamente | ||
| document.querySelector('form[name="search"]') | ||
| // 5.El primer inputen el form. | ||
| form.getElementsByTagName('input')[0] | ||
| //o | ||
| form.querySelector('input') | ||
| // 6.El último inputen el form. | ||
| let inputs = form.querySelectorAll('input') //encontrar todos los inputs | ||
| inputs[inputs.length-1] //obtener el último | ||
| ``` |
12 changes: 6 additions & 6 deletions2-ui/1-document/04-searching-elements-dom/1-find-elements/table.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions2-ui/1-document/04-searching-elements-dom/1-find-elements/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.