title: Select element by element's content
body: <p>I have list:</p>
  
  <pre><code>&lt;ul class='mates'&gt;
     &lt;li class='m' id='1'&gt;Jakub&lt;/li&gt;
     &lt;li class='f' id='2'&gt;Vinnie&lt;/li&gt;
     &lt;li class='m' id='3'&gt;David&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>How can I select 'li' tags "ONE BY ONE" to be checked if their content (between 'li' tags) is equal to 'xyz'.</p>
  
  <pre><code>element = document.getElementsByClassName('.mates').firstChield.innerHTML;
  do {
      if(){
          //do something
      }
  }while (element = element.nextSibling);
  </code></pre>
  
  <p>but I'm not getting even far enough to select firstChild. This error is showing in console: "Cannot read property 'innerHTML' of undefined". This needs to be done in plain JavaScript. Any ideas?</p>