jQuery find/replace without changing original text

后端 未结 5 831
感动是毒
感动是毒 2020-12-09 14:06

Is there a way in jQuery to find a string of text in jQuery and not replace it with something else but wrap that text with an element so when the script is finished it spits

5条回答
  •  孤城傲影
    2020-12-09 14:18

    I think you might use javascript:

    var t= "Hello world to all people";
    var output = t.replace("world to", "world to"));
    alert(output);
    

提交回复
热议问题