title: How to change a website image with javascript?
body: <p>I'm working with my first Greasemonkey script.</p>
  
  <p>And its for a website that have a logo, i want to change the image to a image i have created, and i wonder how i do this?</p>
  
  <p>like use JavaScript to edit the current html document and replace the image.</p>
  
  <p>Thanks for any help!</p>
  
  <p><strong>Edit:</strong> <em>The image is inside a <code>&lt;img&gt;</code> tag, the image i want to change/replace is in this code:</em></p>
  
  <pre><code>&lt;img class="fb_logo img" src="https://s-static.ak.facebook.com/rsrc.php/v1/yp/r/kk8dc2UJYJ4.png" alt="Facebook logo" width="170" height="36"&gt;
  </code></pre>
  
  <p>Here is the javascript code i tryed and didnt work:</p>
  
  <pre><code>var myImage = document.querySelector('.fb_logo img');
  myImage.src = "http://happylifeinnyc.com/wp-content/uploads/2011/07/facebook_love_heart.png";
  </code></pre>