This code adds the text liked inside div.gdt-starrating:
$("a.gdt-starrating").live("click", function() {
$("div.gdt-starrating").text("liked");
});
But this code doesn’t work (no text is added to div.gdt-starrating:
$("a.gdt-starrating").live("click", function() {
$(".gdup div.gdt-starrating").text("liked");
});
Before clicking a.gdt-starrating:
<div id="gdsr_thumb_197_a_up" class="gdt-size-20 gdthumb gdup"><div class="gdt-starrating"></div></div>
After clicking a.gdt-starrating:
<div id="gdsr_thumb_197_a_up" class="gdt-size-20 gdthumb gdup"><a class="gdt-starrating"></div></div>
Why adding .gdup is making the thing not to work?
(Sorry for the title but I’m not pretty sure about the technical way of saying it).
this is the correct way to use multiple class.
if the class is of the same element, you do not seperate by space, but join by id, as above