title: Dynamically Change the href path of image using jquery
body: <p>I am not sure is possible or not but someone know suggest me if possible.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;a href="image/image.jpg"&gt;&lt;img src="image/image.jpg" alt="image"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>in this how to change the href path to another image dynamically using jquery. 
  i.e.,</p>
  
  <pre><code>&lt;a href="image/img.jpg"&gt;&lt;img src="image/image.jpg" alt="image"/&gt;&lt;/a&gt; like this.
  </code></pre>
  
  <p><strong>EDITED:</strong>
  If</p>
  
  <pre><code>&lt;a href="#"&gt;&lt;img src="image/image.jpg"/&gt;&lt;/a&gt;
  &lt;a href="http://stackoverflow.com"&gt;&lt;img src="image/image.jpg"/&gt;&lt;/a&gt;
  &lt;a href="image/image.jpg"&gt;&lt;img src="image/image.jpg"/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>How can i vary this <code>href attr</code> that condition should satisfy only when the anchor tag of href link contain image. then the anchor text is should <code>img</code> tag.</p>
  
  <p><strong>Here is the JSFIDDLE:</strong>
  <a href="http://jsfiddle.net/HMsSE/2/" rel="nofollow">http://jsfiddle.net/HMsSE/9/</a>
  Any suggestion would be much appreciated.</p>
  
  <p>Thanks,
  vicky</p>