getelementsbyclassname - Get elements by class A or B in JavaScript -


Is it possible to get a elements of specific classes? No is similar to achieving all elements of the specified elements.

For example, I want to capture all the elements whose category is either one , two , or three < / Code>.

Maybe something like this:

  one more two fold = document. GetElementsByClassName ("one, two, three");  

I do not even want to use jQuery. Is the only option for getElementsByClassName for each category and add them?

accepts much CSS selector:

  var oneTwoThree = document .querySelectorAll ('.a, .two, .three');  

Comments