jQuery to pull text from list of links
<p>I am trying to use jQuery to search through a list of links and grab the text from a link that matches the criteria. Here is a sample structure:</p>

<pre><code>&lt;div class="shortcut_box"&gt;
    &lt;p&gt;Select a category&lt;/p&gt;
    &lt;ul id="select_nav"&gt;
    &lt;li&gt;&lt;a href="doing-business/directory/#acupuncture"&gt;Acupuncture&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="doing-business/directory/#advertising"&gt;Advertising&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="doing-business/directory/#apparel"&gt;Clothing and Apparel&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="doing-business/directory/#automotive"&gt;Automotive&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="index_heading"&gt;&lt;/h3&gt;​
</code></pre>

<p>There is a script which sets a variable to the string that comes after the hash tag (such as "apparel"). I would like to take that variable, search the list for the item with the link that ends in "apparel" and set the H3 tag to "Clothing and Apparel".</p>

<p>The variable is set on mouse clicks but also by checking the url when the page loads, so I cannot use a function which is based on a mouse click.</p>

<p>Here is some code I have been playing with but is not working:</p>

<pre><code>// manually set url variable for testing
url = 'apparel';
$('#index_heading').html($("#select_nav a[value.match(/url$/)]").text());
</code></pre>

<p>Any help would be greatly appreciated.</p>
