How do I add a css class to an <li> element that contains a given ID using jQuery?
<p>I want to add an active class to the <code>&lt;li&gt;</code> that an ID is in, for example:</p>

<pre><code>&lt;li&gt;&lt;a href="" id="foo"&gt;text&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>How can I add a class to the <code>&lt;li&gt;</code> that <code>#foo</code> is in?</p>
