How can i select the ul li under this if i find a add class to first li which is having achor
<p>Please help me figure out how to add a class to <code>li</code> where an anchor is present.</p>

<pre><code>&lt;ul&gt;
    &lt;li&gt;abc&lt;/li&gt;
    &lt;li&gt;abc&lt;/li&gt;
    &lt;li&gt;&lt;a&gt;abc&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a&gt;abc&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;abc&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I want to add a class to first <code>li</code> where anchor tag is present within the <code>ul</code></p>
