I got this html
<tr>
<td>
Main Alliase/Current Alliase:
</td>
<td><input type="text" id="maina" class="countchars" max="30"/><br />
<span class="showchars"></span>
</td>
<td><span id="handle-1" class="selector" title="The Main Alliase with which people know you OR the alliase with which u play most <br /> <b>You'r App would be also named after this only</b>" header="Main Alliase/Current Alliase">?</span></td>
<td><div id="error-1" class="errors"></div></td>
</tr>
And this js:
$('#maina').focus(function() {
$(this).closest("tr").find(".selector").qtip('toggle', true);
$(this).nextAll(".errors:first").html("Bla");
$(this).siblings(".showchars").show();
});
But the when i focus into the maina
it does the other 2 things but doesnt changes the html of errors
class.
Why so ? What have i been doing wrong ? Please help me Thanks
I think you should do:
$(this).closest('tr').find(".errors:first").html("Bla");
Yhis is because nextAll() looks for siblings (Get all following siblings of each element in the set of matched elements, optionally filtered by a selector
), and the only sibling of maina is the span
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With