title: jQuery Storing Element in a Variable
body: <p>I have the code below which when a list item is clicked an animation occurs.</p>
  
  <p>What I'm having trouble with is making the list item when clicked again reverse the animation effect.</p>
  
  <p>I'm trying to store the clicked list item in a variable but having trouble with this as my variable never stores the elements details?</p>
  
  <p>There may be a better way of doing this but any help or advice would be great?</p>
  
  <pre><code> &lt;ul class="circles"&gt;
       &lt;li class="c-1"&gt;&lt;div class="c-1-active"&gt;Text Link&lt;/div&gt;&lt;/li&gt;
       &lt;li class="c-2"&gt;&lt;div class="c-1-active"&gt;Text Link&lt;/div&gt;&lt;/li&gt;
       &lt;li class="c-3"&gt;&lt;div class="c-1-active"&gt;Text Link&lt;/div&gt;&lt;/li&gt;
    &lt;/ul&gt;
  
  
  
  $('#home ul.circles li').click(function() {
      alert(testing);
      if(testing &gt; "" || testing == $(this).find('div'))
      {
          testing.animate({opacity: 0, top:'180px'}, 1000 );
      }
          $(this).find('div').animate({opacity: 0.8, top:'0'}, 1000 );
          var testing = $(this).find('div');
  
  });
  </code></pre>