title: Changing image src with jQuery
body: <p>I'm replacing some code in an old application, and instead of getting the node by it's id I get it by it's class. Because there isn't a good way to get a node by it's class in native JS I do it with jQuery, however the new code doesn't change the img src.</p>
  
  <p>Is there an obvious reason?</p>
  
  <p>Old code:</p>
  
  <pre><code>var gamearea = document.getElementById('gamearea')
  var images = gamearea.getElementsByTagName('img');
  images[place] = "pics/" + id + ".png";
  </code></pre>
  
  <p>New code:</p>
  
  <pre><code>$('.gamearea').children('img').eq(place).src = "pics/" + id + ".png";
  </code></pre>