JQuery code to remove all spaces with one content but one
Let's say I have the following html:
<span class="fruit">Apple</span>
<span class="fruit">banana</span>
<span class="fruit">Apple</span>
<span class="fruit">Apple</span>
<span class="fruit">orange</span>
I tried different methods, but this did not work, I want the jQuery code to delete all (.fruit) gaps with one content, but keep one (if possible, the first), so I get the following:
<span class="fruit">Apple</span>
<span class="fruit">banana</span>
<span class="fruit">orange</span>
thank
+3