title: How change class for all elements after and before this element?
body: <p>Good day.</p>
  
  <p>I have code html:</p>
  
  <pre><code>&lt;span class="empty-star level" style="cursor:pointer" id="1"&gt;&lt;/span&gt;
  &lt;span class="empty-star level" style="cursor:pointer" id="2"&gt;&lt;/span&gt;
  &lt;span class="empty-star level" style="cursor:pointer" id="3"&gt;&lt;/span&gt;
  &lt;span class="empty-star level" style="cursor:pointer" id="4"&gt;&lt;/span&gt;
  &lt;span class="empty-star level" style="cursor:pointer" id="5"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I would like that when i click on element with class <code>level</code> all elements before him, change class with <code>empty-class</code> to <code>good-class</code> and all elements after him change class with <code>good-class</code> to <code>empty-class</code>.</p>
  
  <p>Tell me please how make this?</p>