Isolating elements by class name


show more Isolating elements by class name provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM show less
please wait ...

Isolating elements by class name

So far, we've looked at picking elements by ID and tag name. So, you're probably thinking that you can also pick elements by class name, and you would be right, sort of. The getElementsByClassName function is a bit of a new addition. Of course, it does that you select that elements with a specific class, but because it is a newer selector it is incompatible with older browsers. Whenever you have a question about whether a browser has support for a method, you should check out a couple of web pages. This one right here called caniuse.com is a really good resource. So, if you scroll down you can see that this method has support in pretty much every modern browser but not older versions of IE. Another page you should check out is the W3C.ompatibilty.

If you scroll down on this page see you can get to the same information on the get element by class name method. Now, I'm using a pretty modern browser here this is a late version of Chrome so you shouldn't have a...

Isolating elements by class name
Video duration: 3m 12s 2h 3m Intermediate

Viewers:

Isolating elements by class name provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM

Subjects:
Developer Web
Software:
HTML JavaScript
Author:
please wait ...