If a div tag looks like:
<div class="class1 class2">blah</div>
Isn't this suppose to still work?
$(".class2").bind("click", .... );
Or does having multiple classes for a element screw things up?
If a div tag looks like:
<div class="class1 class2">blah</div>
Isn't this suppose to still work?
$(".class2").bind("click", .... );
Or does having multiple classes for a element screw things up?
Yes, this will still work regardless of how many classes are on the tag.
Yes, that will work fine as long as you are aware that it will bind the click event for every element that has ".class2" set.
Why? What's happening?
I've tested your code in both IE8 and Firefox 3.5.3, and it works perfectly.
If it's not working for you, there must be some other reason for that.
Multiple classes on an element are valid. The following should illustrate some examples to help understand the JQuery class selector.
<div class="class1">one</div>
<div class="class2">two</div>
<div class="class1 class2">three</div>
Then
//will bind to the first and third div
$(".class1").bind("click", .... );
//will bind to the second and third driv
$(".class2").bind("click", .... );
//will bind to only the third div, you get only elements that have BOTH classes
$(".class1.class2").bind("click", ....);
//will bind to all divs, you get elements with class1 along with elements with class2
$(".class1, .class2").bind("click", ....);