<p>I'm using jQuery and wanting to target the nth &lt;li&gt; in a list after clicking the nth link.</p>

<pre><code>&lt;ul id="targetedArea"&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="clickedItems"&gt;
  &lt;a&gt;&lt;/a&gt;
  &lt;a&gt;&lt;/a&gt;
  &lt;a&gt;&lt;/a&gt;
  &lt;a&gt;&lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>I can target them individually, but I know there must be a faster way by passing which &lt;a&gt; element I clicked on.</p>

<pre><code>$("#clickedItem a:eq(2)").click(function() {
  $("#targetedArea:eq(2)").addClass('active');
  return false;
});
</code></pre>

<p>Cheers,<br />
Steve </p>

how about something like this:
```
```
$('#clickedItems a').click(function() {
// figure out what position this element is in
   var n = $('#clickedItems a').index($(this) );
// update the targetedArea
   $('#targetedArea li:eq('+n+')').html('updated!');
   return false;
});
```
```
assuming a 1:1 relationship between your
```
<a>
```
and
```
<li>
```
elements it will update the appropriate
```
<li>
```