title: css selector for nth element of type - weird implementation of nth-of-type()
body: <p>I may be stupid but I'm trying to select the 2nd div that has the class specialclass. Whats the right querySelector for this?</p>
  
  <p>For test purpost I thought to use <code>document.querySelector("#content-wrapper &gt; .specialclass:nth-of-type(2)");</code> I thought <code>nth-of-type</code> is used for this. but it returns undefined.<code>nth-of-type</code> as well as <code>nth-child</code> seem to count from the parent element. The problem is that the order of elements change pretty often.</p>
  
  <p>Website Structure</p>
  
  <pre><code> &lt;div id="content-wrapper"&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="specialclass"&gt;Can be selectet through document.querySelector(".specialclass:nth-of-type(3)");&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="specialclass"&gt;element I'd like to select. Can be selectet through document.querySelector(".specialclass:nth-of-type(7)");&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
    &lt;div class="a"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>IMPORTANT: Please be aware I CANNOT change the website markup!</p>