title: How to change img src directory or image file name with jquery or PHP
body: <p>I would like to change the image path directory or append the the image file by adding a class to the parent container.</p>
  
  <p>Example: If I add a class of "large" to the parent <code>img</code> container, I would like it to either append the <code>img</code> file name or change the <code>img</code> path.</p>
  
  <pre><code>   src="/images/services/image.jpg" changed to src="/images/services/image-large.jpg"
  
     or
  
     src="/images/services/image.jpg" changed to src="/images/services/large/image.jpg"
  
     ...............................................................................
  
  
  
       default, no class:
  
          &lt;div&gt;
              &lt;img src="/images/services/image.jpg" alt="" /&gt;
          &lt;/div&gt;
  
       Option 1, with class:
  
          &lt;div class="large-image"&gt;
              &lt;img src="/images/services/image-large.jpg" alt="" /&gt;
          &lt;/div&gt;
  
  
       Option 2, with class:
  
  
          &lt;div class="large-image"&gt;
              &lt;img src="/images/services/large/image.jpg" alt="" /&gt;
          &lt;/div&gt;
  </code></pre>