title: jQuery function parameters to set SRC for image
body: <p>How can I set SRC from parameters for large number of images?</p>
  
  <p>I have 5 links like</p>
  
  <pre><code>&lt;span onclick="showim('http://www.iiacanadanationalconference.com/wp-content/uploads/2013/01/test.jpg');"&gt;Show Image 1&lt;/span&gt;
  &lt;span onclick="showim('img2.jpg');"&gt;Show Image 2&lt;/span&gt;
  &lt;span onclick="showim('img3.jpg');"&gt;Show Image 3&lt;/span&gt;
  &lt;span onclick="showim('img4.jpg');"&gt;Show Image 4&lt;/span&gt;
  &lt;span onclick="showim('img5.jpg');"&gt;Show Image 5&lt;/span&gt;
  </code></pre>
  
  <p>Only one image placeholder</p>
  
  <pre><code>&lt;img src="" id="implace" width="100" /&gt;
  </code></pre>
  
  <p>And, JS code like this</p>
  
  <pre><code>$(document).ready(function () {
       $(function showim(imid) {
           var src = $("implace").attr("src").match(/[^\.]+/) + imid;
           $("#implace").attr("src", src);
       });
  });
  </code></pre>
  
  <p>How can I make this code work? Can't understand why it's not working. Thanks</p>
  
  <p>JSFiddle link: <a href="http://jsfiddle.net/yessx/" rel="nofollow">http://jsfiddle.net/yessx/</a></p>