jquery comparing href + url and 'contains' issue
<p>I have some jquery here:</p>

<pre><code>    $(document).ready(function () {
        $('a[href*="' + window.location.href + '"]').css('font-weight', 'bold');

        //check that the text exists in the div and make top menu item bold
        $("ul#menu2 div:contains('About Us')");
        {
            $("ul.sf-menu li a:contains('About Us')").css('font-weight', 'bold');
        }
   });
</code></pre>

<p>The problem is onpage load the URL wont have anything but www.website.co.uk
The code is matching the url with the href in the menu and then making it bold.</p>

<p>When you click on a menu item its fine as the URL shows www.website.co.uk/aboutus/abgroup.apx</p>

<p>The 2nd part of the jquery checks a word in the left menu of one of the pages and then adds the style to the top menu which also matches that string. But it seems to be making all the top menu items bold.</p>

<p>Any ideas.</p>

<p>I need something like, on page load if URL contains .co.uk on the end then make the home <code>li a</code> bold.</p>

<p><strong>MENU MARKUP:</strong></p>

<pre><code>&lt;ul class="sf-menu"&gt;
    &lt;li class="first"&gt;&lt;a href="http://www.site.co.uk/en-us/home.aspx"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li class=""&gt;&lt;a href="http://www.site.co.uk/en-us/aboutus/abgroup.aspx"&gt;About Us&lt;/a&gt;&lt;/li&gt;
    &lt;li class=""&gt;&lt;a href="http://www.site.co.uk/en-us/casestudies.aspx"&gt;Case Studies&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>This is a 2 part question, </p>

<p><strong>1)</strong> i need to stop the jquery making everything bold when the url is just www.website.co.uk as its failing on the compare with href and url.</p>

<p><strong>2)</strong> need to know why on some pages the contains is highlighting all the time (this might be because i am not specific enough, i am using an ID to check but the top menu isnt.)</p>

<p><strong>This is my "About Us" menu:</strong> 
(I also have services and sectors and the same principle applies - i want to search the div from the menu and make the top corresponding menu item bold.</p>

<pre><code>&lt;ul id="menu2"&gt;
    &lt;div&gt;About Us&lt;br&gt;
    &lt;/div&gt;
    &lt;li&gt;&lt;a href="/en-us/aboutus/ABgroup.aspx" class="current"&gt;A&amp;amp;B Group&lt;/a&gt;&lt;/li&gt;
    &lt;li style="padding-left: 10px;"&gt;&lt;a href="/en-us/aboutus/csr.aspx"&gt;CSR&lt;/a&gt;&lt;/li&gt;
    &lt;li style="padding-left: 10px;"&gt;&lt;a href="/en-us/aboutus/csr/sustainability.aspx"&gt;Sustainability&lt;/a&gt;&lt;/li&gt;
    &lt;li style="padding-left: 10px;"&gt;&lt;a href="/en-us/aboutus/csr/healthsafety.aspx"&gt;Health &amp;amp; Safety&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/aboutus/ab/aluminiumsheets.aspx"&gt;Aluminium Sheets&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/aboutus/ab/test.aspx"&gt;Test&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/aboutus/ab/cars.aspx"&gt;Cars&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/aboutus/ab/houseinteriors.aspx"&gt;House Interiors &lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="/aboutus/ab/abreports.aspx"&gt;A&amp;amp;B reports&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
