finding if the selected item is in a set
<p>I am using a bit of jquery and javascript mashed up in this weird hodgepodge of code.</p>

<pre><code>var SELECTED_ELEMENT;  //this ends up being a JS array of ELEMENTS like the following line.
SELECTED_ELEMENT.push($(this).closest(".draggable"));
//Now i wanted to select stuff
$(".draggable").click(function(){
   var found = 0;
   for (var i = 0; i &lt; SELECTED_ELEMENT.length; i++){
      if(SELECTED_ELEMENT[i] == this){
         found = 1;
      }
   }
   if(found == 1){
      alert("yep");
   }else{
      alert("nope");
   }
});
//this doesnt seem to do what i want.
</code></pre>

<p>The question at hand is that this is never returning true, even when it is.  I was just trying to find a way to in javascript search the array for it.  You would think that a simple search through the array would figure it out, but possibly an improper reference to 'this'</p>
