JavaScript DOM Tutorial #3 - Get Elements By Class or Tag

preview_player
Показать описание
Hey gang, in this JavaScript DOM tutorial, I'll show youhow we can query the DOM for elements with a certain class name, or tag name. The methods we'll use are:

- getElementsByTagName()
- getElementsByClassName()

----- COURSE LINKS:

---------------------------------------------------------------------------------------------
Other tutorials:

----- JAVASCRIPT FOR BEGINNERS:

----- CSS FOR BEGINNERS:

----- NODE.JS TUTORIALS

============== The Net Ninja =====================

================== Social Links ==================

Рекомендации по теме
Комментарии
Автор

I can't believe this content is free. Thank you so much for educating us!

anarosol
Автор

There was a wix ad in this video. Wix is for noobs. At least I supported this channel

mrcoder
Автор

The Net Ninja is a life changer channel!
best content on the web

bacn
Автор

Finally, a useful series! Man, there's so much useless junk out there. I have one question though; how did you know to use [i] in the console log? Like, how did you come to the conclusion that the [ and ] characters were specifically needed to do what you needed to do?

scottonanski
Автор

Great job explaining and breaking down the DOM concept.

kolyxix
Автор

An alternative way to iterate array-like objects is to use ES6's for..of, which is pretty nice: for (const el of { .... }

vsizikov
Автор

thank you, many people stocked in here and didn’t know what happened...

taiwanSmart
Автор

Wow! This IS the kind of things people should seek, THANK YOU! This is awesome!

tallitvak
Автор

Finally - a tutorial on DOM that makes sense. Where can we access the repo? Is it still available?

finnyforever
Автор

Thank you for this content. You're amazing.

Rasminda_Alariat
Автор

Not gonna lie, since it's removal, i scream in my head the WOAAHH! after the intro music, everytime :(

meleecraft
Автор

You're my one of fav youtuber !! Keep it up bro :)

charsipandavlog
Автор

Array.from(), it's awesome! Thanks man!

Cho
Автор

for/of is also another way of iterating through nodeList and HTMLColelction.

jamescathode
Автор

Now there's an even easier way to turn non-arrays into arrays with the spread operator, like so: var myArray = [...nonArray];

artempetrov
Автор

Thank you for the great tutorial. Especially casting HTML collection to an array, my question is, is this operation expensive? Does it involve unboxing? I know that this is probably irrelevant for small collections of 6 to 10 items, just curious if that will be relevant for large collections.

georgesdahdouh
Автор

Great Video, Thank you 😍
please, What is the name of the theme you are using at Atom?

tkahmedkamalTV
Автор

We can use for (title of titles) {...} . The for loop from ES6 loops through HTML collection. I think.

alexpanas
Автор

For anyone not getting anything on the console, check you "var titles". It should be defined as document.getElementsByClassName("title"), NOT

togotowesteast
Автор

Good explanation. Its possible to add a Class using "titles" for the Div? means asking its possible to add another class to the existing using "titles" collection iterate ?

venkateshprabhu
visit shbcf.ru