When I use the class selector, will I be selecting all elements with that class, or just the first instance of that class?


#1

Question

When I use the class selector, will I be selecting all elements with that class, or just the first instance of that class?

Answer

When we use the jQuery class selector ('.class') we are selecting all elements with that specific class just like if we were using the .getElementsByClassName() JavaScript DOM method.