title: Get <img> src and set as variable via class (id not available)
body: <p>I'm trying to get the URL of a certain image out of the given HTML code</p>
  
  <pre><code>&lt;div class="image_div_name"&gt;
      &lt;img src="http://www.thisistheimage.com" alt=""&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So this is my current code that should solve it:</p>
  
  <pre><code>var picture = document.getElementsByClassName("image_div_name");
  var src = picture[0];
  </code></pre>
  
  <p>If I now print picture via console.log, I get the correct div:</p>
  
  <pre><code>&lt;div class="image_div_name"&gt;
      &lt;img src="http://www.thisistheimage.com" alt=""&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>However, if I want to access the src, it doesnt seem to work:</p>
  
  <pre><code>var src = picture[0].src;
  console.log(src);
  </code></pre>
  
  <p>Gives back:</p>
  
  <pre><code>undedfined
  </code></pre>
  
  <p>If I try:</p>
  
  <pre><code>console.log(picture[0].innerHTML)
  </code></pre>
  
  <p>it gets better and I receive:</p>
  
  <pre><code>&lt;img src="http://www.thisistheimage.com" alt=""&gt;
  </code></pre>
  
  <p>However I'm looking for way to merely get the URL itself, as in:</p>
  
  <pre><code>http://www.thisistheimage.com
  </code></pre>
  
  <p>Can you help? What am I doing wrong?</p>