If you want to get an element with a class but not another, For instance, I want an element with class1 but not class2, How do I do that without iterating?
Using querySelector, you can do -
var getClassOne = document.querySelectorAll( '.class1:not(.class2)' );
More information can be found here - http://stackoverflow.com/questions/19492716/get-elements-with-one-class-but-not-another-without-iterating