How to get the ID of a selected <li> or <a> with jQuery?
<p>I have a list like this:</p>

<pre><code>&lt;li class="nav" id="1"&gt;&lt;a href="#detail"&gt;a&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav" id="2"&gt;&lt;a href="#detail"&gt;b&lt;/a&gt;&lt;/li&gt;
&lt;li class="nav" id="3"&gt;&lt;a href="#detail"&gt;c&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>Now I want to use jQuery to save the id (1,2 or 3) which was clicked.
How to do this?</p>
