jquery remove span in breadcrumb
<p>I would like to remove some elements of a breadcrumb.
Essentialy <strong>> Pages > default</strong>
What is the best way to remove those accross the site with jQuery ?</p>

<p>Home > Agenda <strong>> Pages > default</strong></p>

<p>The result would be Home > Agenda</p>

<pre><code>&lt;div class="breadcrumb"&gt;    
&lt;span id="ctl00_PlaceHolderTeqBreadcrumb_siteMapPath"&gt;
    &lt;span&gt;&lt;a href="/" class="ms-sitemapdirectional"&gt;Home&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/Agenda" class="ms-sitemapdirectional"&gt;Agenda&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/Agenda/_layouts/listform.aspx?ListId=%7BA82B0240%2D8259%2D4F79%2DA710%2D66E4BA436A53%7D&amp;amp;PageType=0" class="ms-sitemapdirectional"&gt;Pages&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/Agenda/Pages/default.aspx" class="current"&gt;default&lt;/a&gt;&lt;/span&gt;
    &lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>Home  > All Meetings <strong>> Pages > default</strong></p>

<p>the result would be Home  > All Meetings</p>

<pre><code>&lt;div class="breadcrumb"&gt;    
&lt;span id="ctl00_PlaceHolderTeqBreadcrumb_siteMapPath"&gt;&lt;span&gt;
    &lt;a href="/" class="ms-sitemapdirectional"&gt;Home&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/AllMeetings" class="ms-sitemapdirectional"&gt;All Meetings&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/AllMeetings/_layouts/listform.aspx?ListId=%7B9A69EF7E%2D31FF%2D49C7%2DA191%2D5CE2240E7ABC%7D&amp;amp;PageType=0" class="ms-sitemapdirectional"&gt;Pages&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/AllMeetings/Pages/default.aspx" class="current"&gt;default&lt;/a&gt;&lt;/span&gt;
    &lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>and in some cases i have</p>

<p>Home > All Meetings > Pages > Functional Meetings</p>

<p>where i would like to remove <strong>> Pages</strong></p>

<p>The result would be</p>

<p>Les Embiez 2012 > All Meetings > Functional Meetings</p>

<pre><code>&lt;div class="breadcrumb"&gt;    
&lt;span id="ctl00_PlaceHolderTeqBreadcrumb_siteMapPath"&gt;
    &lt;span&gt;&lt;a href="/" class="ms-sitemapdirectional"&gt;Home&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;&lt;span&gt;&lt;a href="/AllMeetings" class="ms-sitemapdirectional"&gt;All Meetings&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;&lt;span&gt;&lt;a href="/AllMeetings/_layouts/listform.aspx?ListId=%7B9A69EF7E%2D31FF%2D49C7%2DA191%2D5CE2240E7ABC%7D&amp;amp;PageType=0" class="ms-sitemapdirectional"&gt;Pages&lt;/a&gt;&lt;/span&gt;
    &lt;span&gt; &amp;gt; &lt;/span&gt;
    &lt;span&gt;&lt;a href="/AllMeetings/Pages/Functional%20Meetings.aspx" class="current"&gt;Functional Meetings&lt;/a&gt;&lt;/span&gt;
    &lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p><b>Edit</b></p>

<p>I am currently using the following JQuery to achieve this:</p>

<pre><code>var url = location.pathname;
        if (url.indexOf('/Pages/default.aspx') &gt;= 0) {
            $(".breadcrumb span").slice(-4).remove()
        }
        else {
            $(".breadcrumb span a:contains('Pages'),.breadcrumb span a:contains('default')").remove();
            $(".breadcrumb span:contains('&gt;')").last().remove();
        }
</code></pre>
