我有我的html结构
<div>
<div class="comments-title-wr clearFix">
<span id="commentsSize" class="comments-title">Some Text</span>
</div>
<div id="testId">
</div>
</div>
我可以检索testId
并使用它来替换<span>
标签内的文本。
我尝试使用
$('#testId').parent().closest('.comments-title').text().replace('something else');
但它不工作