2
<div>something i need</div>

<span>x</span>

<div>something i need</div>

<span>x</span>

<div>something i need</div>

<span>x</span><span>x</span><span>x</span>

<div>something i need</div>

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.

edit: made the html correct so people focus on the actual issue.

  • where are the li elements? – zkanoca May 10 '13 at 09:09
  • Where are the 3 li elements – visnu May 10 '13 at 09:10
  • I changed them to spans because of the first comment. I didn't really write correct html at first, didn't think anyone would point that out considering my issue is not in any way related. –  May 10 '13 at 09:12
  • Have a look at http://stackoverflow.com/questions/2822962/jquery-remove-duplicate-elements – Aamir Afridi May 10 '13 at 09:15