title: Finding an item with JQuery whose index matches a count variable
body: <p>I have an image scroller set up, and I keep a count of the current item through a variable called current_item. Now, I want to display the alt text of the image in a list of images whose index matches the item_count. </p>
  
  <p>Here's the JQuery</p>
  
  <pre><code>var scroll_text = $('#ax_campaign_content li').index(current_item).children('img').attr('alt');
  $('#ax_campaign_scroller h4').text(scroll_text);
  </code></pre>
  
  <p>And this is the basic html structure:</p>
  
  <pre><code>&lt;div id="ax_campaign_content"&gt;
      &lt;ul&gt;
      &lt;li&gt;&lt;img alt="Image 1"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;img alt="Image 2"&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div id="ax_campaign_scroller"&gt;
      &lt;h4&gt;Image Text Goes Here&lt;/h4&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is what I'm trying to do but it's not working. Anybody see where I'm going wrong?</p>