title: getElementsByTagName is not a function
body: <p>I am really struggling this. I am wanting to change the src attribute of an img tag and get the error message getElementsByTagName is not a function. The following is my test markup</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div class="logo"&gt;
  &lt;img src="/a.jpg"&gt;
  &lt;/div&gt;
  &lt;script&gt;
  document.getElementsByClassName('logo').getElementsByTagName('img')[0].src ="/b.jpg";
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any advice is appreciated.</p>