Jquery open all parent ul with list link
<p>I have a menu structure like:</p>

<pre><code>&lt;ul id="menu"&gt;
    &lt;li&gt;
        &lt;a href="javascript:void(0)"&gt;HR&lt;/a&gt;
        &lt;ul&gt;
            &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Address&lt;/a&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="listcountrymaster.aspx"&gt;Country&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="listregionmaster.aspx"&gt;Region&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;

            &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Assets&lt;/a&gt;
                &lt;ul&gt;
                    &lt;li&gt;&lt;a href="ListVendorMaster.aspx"&gt;Vendor&lt;/a&gt;&lt;/li&gt;
                     &lt;li&gt;&lt;a href="Listassetmaster.aspx"&gt;Asset&lt;/a&gt;&lt;/li&gt;
                &lt;/ul&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>what I want to do is:
I want to open all parent <code>&lt;ul&gt;</code> above the link with <code>href="ListVendorMaster.aspx"</code></p>

<p>something I have tried is:</p>

<pre><code>var openmenu = 'ListVendorMaster.aspx';
$('#menu ul').hide();
if(openmenu)
{
    $('a[href="'+openmenu+'"]').closest('ul').show();
}
</code></pre>

<p>with this I am able to open only one level parent ul.</p>

<p>thanks</p>
