{"action":"created","comment":{"url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/comments/175800304","pull_request_review_id":105389293,"id":175800304,"diff_hunk":"@@ -0,0 +1,91 @@\n+Поиск элементов\n+// важность: 4\n+// Ниже находится документ с таблицей и формой.\n+\n+// Найдите (получите в переменную) в нём:\n+\n+// Все элементы label внутри таблицы. Должно быть 3 элемента.\n+// Первую ячейку таблицы (со словом \"Возраст\").\n+// Вторую форму в документе.\n+// Форму с именем search, без использования её позиции в документе.\n+// Элемент input в форме с именем search. Если их несколько, то нужен первый.\n+// Элемент с именем info[0], без точного знания его позиции в документе.\n+// Элемент с именем info[0], внутри формы с именем search-person.\n+// Используйте для этого консоль браузера, открыв страницу table.html в отдельном окне.\n+\n+//1\n+var table = document.getElementById('age-table');\n+console.log(table.getElementsByTagName('label'));\n+\n+//2\n+var table = document.getElementById('age-table');\n+//поясни коротко чому рядок нижче виводить текст\n+// console.log(table.firstChild);\n+\n+console.log(table.rows[0].cells[0]);\n+\n+//3\n+var forms = document.getElementsByTagName('form');\n+console.log(forms[1]);\n+\n+//4\n+var form = document.getElementsByName('search')\n+console.log(form);\n+\n+//5 підглядів у розвязку пізніше, бо пропустив його\n+console.log(document.querySelector('form[name = search] input'));\n+\n+//6\n+var elem = document.getElementsByName('info[0]')\n+console.log(elem);\n+\n+//7 тут теж підглянув бо не розумів як його знайти коли його нема\n+document.querySelector('form[name=\"search-person\"] [name=\"info[0]\"]');\n+\n+-- -- -- -- -- -- -- -- -\n+\n+Дерево\n+важность: 5\n+    // Есть дерево из тегов <ul>/<li>.\n+\n+// Напишите код, который для каждого элемента <li> выведет:\n+\n+// Текст непосредственно в нём (без подразделов).\n+// Количество вложенных в него элементов <li> – всех, с учётом вложенных.\n+\n+\n+//це так я мучився\n+// var elem = document.body.getElementsByTagName('ul').childNodes;\n+// alert(elem);\n+\n+// function render(elem) {\n+//     [].forEach.call(elem, function(item, i) {\n+//         if (typeof elem.children[i] == 'text') {\n+//             alert(elem.children[i]);\n+//         }\n+//         if (elem.children[i].firstElementChild != null) {\n+//             render(elem.children[i].childNodes)\n+//         }\n+\n+//     });\n+// }\n+\n+//тут підійшов уже близько, але все одно виводить вузол повністю. не знаю як назву вирвати звідти.\n+//щодо астосування рекурсії - то явпевнений. також пробував застосовувати innerHTML. результат той самий - на \n+// найглибших вкладеннях працює коректно, а вище виводить код цілого вузла. до речі про ці методи нічо не \n+//було сказано в уроці. мусив вишуковувати\n+var element = document.body.getElementsByTagName('li');\n+\n+function render(elem) {\n+    for (let index = 0; index < elem.length; index++) {\n+        if (elem[index].firstChild != null) {\n+            alert(elem[index].textContent[0]);\n+        } else {\n+            render(elem.firstChild);","path":"DOM/DOM-search.js","position":84,"original_position":84,"commit_id":"f98189c5bd0e91e9748b638d476f16441078a7ca","original_commit_id":"f98189c5bd0e91e9748b638d476f16441078a7ca","user":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"body":"тобто console.log(elem.firstChild)??? виводить всі undefined","created_at":"2018-03-20T15:04:01Z","updated_at":"2018-03-20T15:04:01Z","html_url":"https://github.com/grygoriy-pinkas/JavaScript/pull/31#discussion_r175800304","pull_request_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/comments/175800304"},"html":{"href":"https://github.com/grygoriy-pinkas/JavaScript/pull/31#discussion_r175800304"},"pull_request":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31"}},"in_reply_to_id":175550496},"pull_request":{"url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31","id":175923450,"html_url":"https://github.com/grygoriy-pinkas/JavaScript/pull/31","diff_url":"https://github.com/grygoriy-pinkas/JavaScript/pull/31.diff","patch_url":"https://github.com/grygoriy-pinkas/JavaScript/pull/31.patch","issue_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/31","number":31,"state":"open","locked":false,"title":"n1 to DOM-search","user":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-19T14:50:29Z","updated_at":"2018-03-20T15:04:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"150b29b33fc8c2978277d981c099bfcac18a52bb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31/commits","review_comments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31/comments","review_comment_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/31/comments","statuses_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/statuses/f98189c5bd0e91e9748b638d476f16441078a7ca","head":{"label":"grygoriy-pinkas:DOM-search","ref":"DOM-search","sha":"f98189c5bd0e91e9748b638d476f16441078a7ca","user":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"repo":{"id":121045037,"name":"JavaScript","full_name":"grygoriy-pinkas/JavaScript","owner":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grygoriy-pinkas/JavaScript","description":"Lerning code JavaScript","fork":false,"url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript","forks_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/forks","keys_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/teams","hooks_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/hooks","issue_events_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/events{/number}","events_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/events","assignees_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/assignees{/user}","branches_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/branches{/branch}","tags_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/tags","blobs_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/statuses/{sha}","languages_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/languages","stargazers_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/stargazers","contributors_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/contributors","subscribers_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/subscribers","subscription_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/subscription","commits_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/contents/{+path}","compare_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/merges","archive_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/downloads","issues_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues{/number}","pulls_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls{/number}","milestones_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/milestones{/number}","notifications_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/labels{/name}","releases_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/releases{/id}","deployments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/deployments","created_at":"2018-02-10T19:04:43Z","updated_at":"2018-03-19T19:11:43Z","pushed_at":"2018-03-19T19:15:19Z","git_url":"git://github.com/grygoriy-pinkas/JavaScript.git","ssh_url":"git@github.com:grygoriy-pinkas/JavaScript.git","clone_url":"https://github.com/grygoriy-pinkas/JavaScript.git","svn_url":"https://github.com/grygoriy-pinkas/JavaScript","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"grygoriy-pinkas:master","ref":"master","sha":"04a174688493d7c1325a0657b5933362dbc2024a","user":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"repo":{"id":121045037,"name":"JavaScript","full_name":"grygoriy-pinkas/JavaScript","owner":{"login":"grygoriy-pinkas","id":30478760,"avatar_url":"https://avatars1.githubusercontent.com/u/30478760?v=4","gravatar_id":"","url":"https://api.github.com/users/grygoriy-pinkas","html_url":"https://github.com/grygoriy-pinkas","followers_url":"https://api.github.com/users/grygoriy-pinkas/followers","following_url":"https://api.github.com/users/grygoriy-pinkas/following{/other_user}","gists_url":"https://api.github.com/users/grygoriy-pinkas/gists{/gist_id}","starred_url":"https://api.github.com/users/grygoriy-pinkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grygoriy-pinkas/subscriptions","organizations_url":"https://api.github.com/users/grygoriy-pinkas/orgs","repos_url":"https://api.github.com/users/grygoriy-pinkas/repos","events_url":"https://api.github.com/users/grygoriy-pinkas/events{/privacy}","received_events_url":"https://api.github.com/users/grygoriy-pinkas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grygoriy-pinkas/JavaScript","description":"Lerning code JavaScript","fork":false,"url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript","forks_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/forks","keys_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/teams","hooks_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/hooks","issue_events_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/events{/number}","events_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/events","assignees_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/assignees{/user}","branches_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/branches{/branch}","tags_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/tags","blobs_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/statuses/{sha}","languages_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/languages","stargazers_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/stargazers","contributors_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/contributors","subscribers_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/subscribers","subscription_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/subscription","commits_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/comments{/number}","contents_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/contents/{+path}","compare_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/merges","archive_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/downloads","issues_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues{/number}","pulls_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls{/number}","milestones_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/milestones{/number}","notifications_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/labels{/name}","releases_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/releases{/id}","deployments_url":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/deployments","created_at":"2018-02-10T19:04:43Z","updated_at":"2018-03-19T19:11:43Z","pushed_at":"2018-03-19T19:15:19Z","git_url":"git://github.com/grygoriy-pinkas/JavaScript.git","ssh_url":"git@github.com:grygoriy-pinkas/JavaScript.git","clone_url":"https://github.com/grygoriy-pinkas/JavaScript.git","svn_url":"https://github.com/grygoriy-pinkas/JavaScript","homepage":null,"size":70,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31"},"html":{"href":"https://github.com/grygoriy-pinkas/JavaScript/pull/31"},"issue":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/31"},"comments":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/grygoriy-pinkas/JavaScript/statuses/f98189c5bd0e91e9748b638d476f16441078a7ca"}},"author_association":"OWNER"}}
{"actor":{"display_login":"grygoriy-pinkas"}}