title: How to add class to first child?
body: <p>I don't understand, why my code is not working. I need to set the class "selected" to the first <code>a</code></p>
  
  <p><strong>My code</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.selected {
    color: green
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    $('.find a:first').addClass('selected');
  &lt;/script&gt;
  
  &lt;div class="events find"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#0"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#0"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#0"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>