Regroup element with jquery
- by kennygunie
Hi,
I have a number of messages on my page like this:
<div class="messages">A</div>
<div class="messages">B</div>
<div class="messages">A</div>
<div class="messages">C</div>
is there any way with jQuery (no PHP) to count and regroup 2 div A like this:
<div class="messages">A</div><span>2</span>
<div class="messages">B</div>
<div class="messages">C</div>
Thank you.