jQuery select elements with incrementing ID's
<p>I would like to select list items based on their incrementing ID's but I am having a bit of trouble. Thoughts? </p>

<pre><code>$(document).ready(function () {

    var listCount = 1;

    $('#listitem-' + listCount + ' a').hover(function() {
            $('#anotheritem-' + listCount).show();
            return false;
    });

    listCount++;
});
</code></pre>

<p>HTML:</p>

<pre><code>&lt;ul id="cap"&gt;
   &lt;li id="listitem-1"&gt;&lt;a href="#"&gt;content 1&lt;/a&gt;&lt;/li&gt;
   &lt;li id="listitem-2"&gt;&lt;a href="#"&gt;content 2&lt;/a&gt;&lt;/li&gt;
   &lt;li id="listitem-3"&gt;&lt;a href="#"&gt;content 3&lt;/a&gt;&lt;/li&gt;
   &lt;li id="listitem-4"&gt;&lt;a href="#"&gt;content 4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="display:none;" id="anotheritem-1"&gt;hello 1&lt;/div&gt;
&lt;div style="display:none;" id="anotheritem-3"&gt;hello 3&lt;/div&gt;
&lt;div style="display:none;" id="anotheritem-3"&gt;hello 3&lt;/div&gt;
&lt;div style="display:none;" id="anotheritem-4"&gt;hello 4&lt;/div&gt;
</code></pre>

<p>UPDATED Question. I'm trying to achieve the following revision of the answer:</p>

<pre><code>$('.listitem_to_hover').hover(function () { 
    var senderID = sender.id.replace('listitem-', '');
     $('#anotheritem-' + senderID).show();
}, function () { 
    var senderID = sender.id.replace('listitem-', '');
     $('#anotheritem-' + senderID).hide();
});
</code></pre>
