title: jquery - remove duplicate consecutive element
body: <pre><code>&lt;div&gt;something i need&lt;/div&gt;
  
  &lt;span&gt;x&lt;/span&gt;
  
  &lt;div&gt;something i need&lt;/div&gt;
  
  &lt;span&gt;x&lt;/span&gt;
  
  &lt;div&gt;something i need&lt;/div&gt;
  
  &lt;span&gt;x&lt;/span&gt;&lt;span&gt;x&lt;/span&gt;&lt;span&gt;x&lt;/span&gt;
  
  &lt;div&gt;something i need&lt;/div&gt;
  </code></pre>
  
  <p>On the row where I have 3 span elements, how do I remove all but one? I only want to have one between each element.</p>
  
  <p>edit: made the html correct so people focus on the actual issue. </p>