我希望将包含$符号的tspan替换为空的tspan可能是一个空格。有没有办法在加载页面时在整个项目中替换它?
答案 0 :(得分:0)
Assuming the original version of your question was what you meant (to display HTML, you need to enclose them in back quotes, e.g. <tspan>
):
To replace every <tspan class="symbol">$</tspan>
with <tspan> </tspan>
, this is one way to do it:
$(
$('tspan.symbol').each(function() {
if ($(this).text() == '$') {
$(this).removeClass('symbol');
$(this).text(' ');
}
});
);