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

python - Referencing Data From a 2D Histogram -

php - MySQL LIMIT results with INNER JOIN with more than 2 tables -

c# - Derived UserControl layout resets after build -