title: Getting the src of an img tag on radio select
body: <p>I have some HTML code as follows:</p>
  
  <pre><code>&lt;div id="input-option227"&gt;
      &lt;div class="radio"&gt;
          &lt;label&gt;
              &lt;input type="radio" name="option[227]" value="17" /&gt;
              &lt;img src="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_1-50x50.jpg" alt="black" class="img-thumbnail" /&gt;
              black
          &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="radio"&gt;
          &lt;label&gt;
              &lt;input type="radio" name="option[227]" value="18" /&gt;
              &lt;img src="http://localhost/upload/image/cache/catalog/demo/apple_logo-50x50.jpg" alt="green" class="img-thumbnail" /&gt;
              green
          &lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to get the <code>img src</code> when I select the radio button means when the radio value is 17 then I want to alert:</p>
  
  <p><code>http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_1-50x50.jpg</code></p>
  
  <p>and when the value is 18 then the alert should be:</p>
  
  <p><code>http://localhost/upload/image/cache/catalog/demo/apple_logo-50x50.jpg</code></p>
  
  <p>What I have done so far is:</p>
  
  <pre><code>$(document).ready(function() {
      $('input:radio[name="option[227]"]').change(function() {
          if ($(this).val() == '17') {
              alert('type A');
          }
          if ($(this).val() == '18') {
              alert('type B');
          }
      });
  }); 
  </code></pre>
  
  <p>What should I do ?</p>