How to select parent object of a hyperlink whose href match the requested page/file name using jQuery?
<p>How to select parent object of a hyperlink whose href match the requested page/file name using jQuery?</p>

<p>I have following code</p>

<pre><code>&lt;div&gt;
&lt;div class="menu-head"&gt;
&lt;a href="empdet.aspx"&gt;employees&lt;/a&gt;
&lt;a href="custdet.aspx"&gt;customers&lt;/a&gt;
&lt;/div&gt;
&lt;div class="menu-head"&gt;
&lt;a href="depdet.aspx"&gt;departments&lt;/a&gt;
&lt;/div&gt;
&lt;div&gt;
</code></pre>

<p>I want a Jquery to change the color of the parent div corresponding a hyperlink. If the user is browsing custdet.aspx the respective parent div background should be changed to red.</p>

<p>Edit: I have a method to retrieve the file name. I just need the right selector to select the parent.</p>
