From faf329ba3ef41f5b031ce0ed093a7c2a021bd330 Mon Sep 17 00:00:00 2001 From: Joseph Bak <36170953+josephbak@users.noreply.github.com> Date: Mon, 4 Apr 2022 18:16:54 -0400 Subject: [PATCH] Fixes in 21_day_dom.md Fixed some typos in 21_day_dom.md. In line 138, querySelector can select any element, not only h1. --- 21_Day_DOM/21_day_dom.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/21_Day_DOM/21_day_dom.md b/21_Day_DOM/21_day_dom.md index 5955c51..31c728b 100644 --- a/21_Day_DOM/21_day_dom.md +++ b/21_Day_DOM/21_day_dom.md @@ -135,10 +135,10 @@ The _document.querySelector_ method can select an HTML or HTML elements by tag n ```js let firstTitle = document.querySelector('h1') // select the first available h1 element let firstTitle = document.querySelector('#first-title') // select id with first-title -let firstTitle = document.querySelector('.title') // select the first available h1 element with class title +let firstTitle = document.querySelector('.title') // select the first available element with class title ``` -**_querySelectorAll_**: can be used to select html element by its tag name or class. It return a nodeList which is an array like object which support array methods. We can use **_for loop_** or **_forEach_** to loop through each nodeList elements. +**_querySelectorAll_**: can be used to select html element by its tag name or class. It returns a nodeList which is an array like object which supports array methods. We can use **_for loop_** or **_forEach_** to loop through each nodeList elements. ```js const allTitles = document.querySelectorAll('h1')