I am having trouble coming up with the correct jQuery selector for the following.
$(this)
equates to
<div class="rating-edit" title="Click to edit...">edit rating</div>
HTML
<p class="r-m"><span class="s5"></span></p>
<div class="rating-edit" title="Click to edit...">edit rating</div>
What I am trying to do is target the s5 span inside the r-m paragraph class but the number after the s can be any number so I can’t target it based on it’s actual class name.
Here is what I have tried:
$(this).siblings('.r-m').child('span').removeClass().addClass('s'+value);
but it doesn’t seem to work.
Try