check to see if the Chapter Title has been referenced two or more times before a different Chapter Title is referenced? then apply a different class
<p>I have a bunch of divs sprinkled throughout a long article. Each one, when clicked, shows a <code>span</code> of hidden text within the div. They're made up of </p>

<p>1) chapter title<br>
2) section number<br>
3) point number</p>

<p>eg: government 3:15 OR whitehouse 15:27 OR legislation 1:38 (there are over 90 chapters).</p>

<p>Using jQuery, i'm trying to see if a chapter title occurs two or more times in a row, if it does, apply a specific class to every one except the first.</p>

<p>Reason being: when referencing these chapter titles, i've placed an icon at the beginning: </p>

<p>eg: <code>(icon)Whitehouse 29:8</code>, but I don't want every single chapter title to have an icon, if that chapter title is referenced two or more times before another chapter title is referenced, then I want the second third forth(etc.) to not have the icon.</p>

<p><strong>Does anyone know how I would go about checking to see if the Chapter Title has been referenced two or more times before a different Chapter Title is referenced?</strong></p>

<p><strong>example:</strong> </p>

<p>He spoke of the many injustices in <code>(icon)Whitehouse 3:15</code>, but the president wasn't speaking of mountains <code>whitehouse 4:2</code> and <code>whitehouse 4:9</code>. When he saw they were ready to begin <code>(icon)congress 19:4</code>, he said "welcome all to this session" <code>(icon)legislation 9:41</code>, then smacked the prime minister in the face <code>legislation 3:8</code></p>
