Javascript 的字符串替换功能似乎正在剥离 HTML 标签,有没有办法禁用它?
例子:
$('#pageEnumeration').text(function(){ return $(this).text().replace(/^Showing \d+-\d+ of/, 'Showing'); });
<p id="pageEnumeration">
Showing 1-25 of 45 records found:
<br>
containing the terms:
<span class="italic">cat</span>
</p>