javascript - Find and replace occurrence of string in whole html itself -


assume

<html>   <head>....</head> <body>  .  .  // occurrences here  .   </body> </html> 

i do

$(function() {     $('html').html() = $('html').html().replace(/strtofind/g,'somethingelse'); }); 

in head, does't work. how find , replace occurrence of string in html document (not store in variable)?
thanks

.html() function returns html, can't assign it. if want change html of object in jquery, put new html parameter function:

$('html').html($('html').html().replace(/strtofind/g,'somethingelse')); 

Comments

Popular posts from this blog

c# - HttpResponseMessage System.InvalidOperationException -

sql - Postgresql error: "failed to find conversion function from unknown to text" -