У меня есть следующий HTML:
<tr>
<td>
<img id='1' class='promote' src='/images/plus.png' />
<span>0</span>
<img id='1' class='demote' src='/images/minus.png' />
</td>
<td>
<img id='2' class='promote' src='/images/plus.png' />
<span>0</span>
<img id='2' class='demote' src='/images/minus.png' />
</td>
...
</tr>
Далее я использую jQuery ajax:
$('img.promote').click(function() {
$.ajax({
url: '/promote/' + this.id,
success: function(data) {
$(???).text(data.rating);
},
dataType: 'json'
});
});
$('img.demote').click(function() {
$.ajax({
url: '/demote/' + this.id,
success: function(data) {
$(???).text(data.rating);
},
dataType: 'json'
});
});
Итак, какую комбинацию селекторов jQuery я должен использовать вместо "???" изменить текст между тегами span? или я все делаю неправильно?