[Solved] Replace a phrase in a HTML document? [closed]


Here you have an example of how you can do it using p tags and jQuery. Hope it helps

var thePhrase = "this is the phrase to replace";
var toReplace = "this is the phrase that replaces thePhrase";
$("p").each(function(){
   var $this = $(this);
    if( $this.html() == thePhrase) {
        $this.html( toReplace );
    }
});

See a demo of it here http://jsfiddle.net/sousatg/w3jCj/

4

solved Replace a phrase in a HTML document? [closed]