Jquery check if parent has an ID
<p>Hi i'm trying to check if a parent element contains an ID</p>

<p>Here is my list</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;li id="selected"&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;/li&gt;
        &lt;li&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>Don't know how to make a correct list in here?</p>

<pre><code>if (jQuery(LiElement).parent("#selected"))
{
    //If parent has id=selected
}
else
{
    //If parent dont have id=selected
}
</code></pre>

<p>Can someone help me please?</p>
