title: Jquery find specific img attr (src)
body: <p>Just knocking up an image switcher, and come across a small issue:</p>
  
  <p>I've got three images hidden, and when hovering over the relevant thumbnail I want to add the class of current to the main image (to stop it being hidden).</p>
  
  <pre><code>$("#thumbs img").mouseenter(function(){
  
  //this gets the url of the thumb
  var imgSrc = $(this).attr("src");
  //this removes the last 7 letters
  imgSrc = imgSrc.slice(0,-7);
  //this adds .jpg to the end
  imgSrc = imgSrc + '.jpg';
  
  //This removes all images class of current
  $('#mainImg img').removeClass("current");
  
  //I want this to find the image with the src of imgSrc and add the current class
  $('#mainImg').find(img.attr("src",imgSrc)).addClass("current");
  </code></pre>
  
  <p>The last line is the issue, it doesn't work - any advice?</p>