title: Replace the attribute value using cheerio
body: <p>The following code is used to replace all the <code>&lt;img&gt;</code> tags <code>src</code> value. But the following code does not modify the original document. <code>$.html</code> prints the original document and not the modified one.</p>
  
  <pre><code>    $ = cheerio.load(data);
      $("img").each(function() {
          var old_src=$(this).attr("src");
          var new_src = "/my_cached_image?url=" + encodeURIComponent(old_src);        
          $(this).prop("src", new_src);
      });
      modified_data = $.html();
  </code></pre>