jQuery 'if' statement not working
<p>This should be a simple <code>if</code> statement, but it's not working for me. Essentially, when you click an element, I want that element to be highlighted and the ID to be put into a the variable <code>value</code>. However, if in the situation the same element is clicked twice, I want to <code>value = NULL</code>. </p>

<pre><code>(function($){ 
  $(".list").click(function() {
     $(this).toggleClass("hilite");
     var temp = $(this).attr('id');
     if (value != temp) {
        var value = $(this).attr('id');
     } else {
        value = NULL;
     }
  });
})(jQuery);
</code></pre>
