jquery How do I add a class to span within a dl based on the text it contains?
<p>I want to be able to add the class="st_sharethis" to the menu link: Tell A Friend on this site <a href="http://www.easyspacedesign.com/fh/ConnectBell_/" rel="nofollow">http://www.easyspacedesign.com/fh/ConnectBell_/</a>. There is no way to add a specific class or id to a menu link in the cms we use so going to have to use jquery to do it. </p>

<p>So I will have to do it based on the text within the span tag that is within the a tag.</p>

<p>So far i have tried:</p>

<pre><code>  $('.main_menu span:contains("Tell A Friend")').attr('class','st_sharethis');

  $('.main_menu span').each(function ()
  {
    if ($(this).text() == "Tell A Friend")
    $(this).attr('id','rev3');
  }
</code></pre>

<p>neither has worked.</p>
