We have already learned some of the methods and in this video, I'm going to show you one of the most
popular and frequently used method, which is Querrey Selecter.
All you remember that we have used in previous videos where Solectron method, which would tell us the
first element that matches, specified a selector in the document.
And the equerry selected all method acts almost in the same way, but it returns all elements in the
document that matches a specified just selector.
All right, let's go back to our text editor, create variable var ice equals and use here Quarrie Selecter,
all method, right.
Document dot query selecta all.
And inside the parentheses, let's select a list element.
Then getting counsel right, counsel, that log, Ellyse.
Reload and you see that we have the same result as it was in case of get aliments by Takanabe method,
but if we drop down it, then you will see that instead of Estima collection, we have something different.
And it is a no no.
This is an object and it's almost the same as an HDMI collection.
Both of them have length property and the endless numbers of items is zero based, but none of them
is in.
Right.
One of the main differences between no less than ideal collection is that no list allows us to use a
right for each method without transforming it into array.
So let's write.
Elyse thought for each.
Then the function.
And inside the parentheses, right, the parameter elai.
Then locating Castle, right, Castle?
Good luck, Ally.
Reload and you see that it works, but it doesn't mean that you can use other methods with Notwist,
we can prove that and let's use push method and Right Aleister to push.
And inside the parentheses, right, hello.
Then refresh and we have, again, an error saying that Ellyse, that push is not a function.
The reason, again, is the same node list like Estima collection is not an array in order to use own
methods, except for each with node lists, you need to transform it into an array.
Regardless of that you can use for each with no list.
I recommend you to always at first transform it into array and use for each and any other methods.
All right.
One of the advantages that, quote, selecter all has is that you can select multiple elements with
multiple selectors.
For example, we can right here, H2 had an element.
That we need to separate the selectors by Colma.
Now let's choose one more element from HTML document.
Let's say development with Edelheit least.
So write this value of the attribute with Pouncy.
Also, that comment is called out for a while and see what we have to refresh.
And I see that all the elements, what we have chosen are put inside our note list, you may notice
that inside parentheses we have written at first list and then to select us.
But if you look at the results, H2 is placed first in no list.
There isn't a simple dictionary.
Select selector or method puts the element in node list.
According to where these elements are placed in the document.
It selects elements line by line, from top to bottom.
So at first it has found H2 heading that lists and then deep element to it.
Edelheit list.
All right.
The last thing that I'm going to show you is that we can change and manipulate on text or estimate contents
of these elements using tax content and in our estimate properties.
Let's remove the comment from here that transform the list into array because as we said, it's a better
practice.
So write a report from.
Elyse.
And now use one of the dump properties, let's say tax content, and change the content of the items
inside novelist.
So right here.
Well, I don't text content.
Equals Hello, world.
Reload and you see that we have changed the tax content of the items into Hello World.
OK, this was all about Querrey Selecta old method, which is one of the frequently used and popular
method of Tom.
Let's move on.