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

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -