小编gia*_*i90的帖子

jquery查找替换多个单词

我正在尝试替换同一个div.
显然这行不通,这是我的代码。

$("#Number").each(function() {
    var text = $(this).text();
    $(this).text(text.replace("Monster", "Witch")); 
});
$("#Number").each(function() {
    var text = $(this).text();
    $(this).text(text.replace("Girl", "Boy")); 
});
Run Code Online (Sandbox Code Playgroud)

谢谢你。

jquery replace words find

3
推荐指数
1
解决办法
9630
查看次数

标签 统计

find ×1

jquery ×1

replace ×1

words ×1