title: How can I get the href from this class in javascript?
body: <p>I have the following piece of html:</p>
  
  <pre><code>&lt;div class="inside-article"&gt;
    &lt;a style="height:70px;" href="blabla"&gt;
      &lt;img width="70" height="70" src="//anysite.com/1234/anypic.jpg" alt="Bugblt4"
    &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Note that this is just an extract; there are more classes built up like that with the same class name, just different href they have.</p>
  
  <p>I'm trying to get the <code>href</code> from this class <code>inside-article</code> and alert it on a page but it doesn't seem to work. So I've read about it maybe there were some hints, read about the getAttribute method and tried to use it but this also didn't work : /</p>
  
  <p>So far I have:</p>
  
  <pre><code>var x = document.getElementsByClassName('inside-article')[0].getAttribute('href');
  alert(x);
  </code></pre>
  
  <p>But how else can I get this work? The alert message I get is only <code>null</code> :(</p>