Using the JS queryselectorall method is it possible to select an elemnent of a particular tag name with 2 matching classes.
E.g. I have an element
<a class="classOne classTwo"></a>
using queryselectorall I can select on one classname:
document.querySelectorAll("a.classOne");
how could this be extended so I can find all a tags with classOne AND classTwo?
document.querySelectorAll(“a.classOne classTwo”); as expected doesn’t seem to work
Thanks in advance
The same way you would in CSS:
example: http://jsfiddle.net/gcf6w/6/