title: chaining using getElementsByClassName and getElementById in javascript
body: <p>Following javascript code throws error</p>
  
  <pre><code>Uncaught TypeError: Object #&lt;HTMLSpanElement&gt; has no method 'getElementById'
  </code></pre>
  
  <p>If this is not allowed how do I search for the existence of particular element inside other element?</p>
  
  <pre><code>var googlePlusPosts = document.getElementsByClassName("mo fj");
  
  for (var i = 0; i &lt;  googlePlusPosts .length; ++i) {
          decryptElements = googlePlusPosts[i].getElementById('decrypt-button');
  .
  .
  .
  </code></pre>