Javascript API writing
<pre><code>&lt;div id ="filter"&gt;
    &lt;select id= "s1"/&gt;
    &lt;select id= "s2"/&gt;
    &lt;select id= "s3"/&gt;
    &lt;select id= "s4"/&gt;
    &lt;select id= "s5"/&gt;
    &lt;select id= "s6"/&gt;
&lt;/div&gt;
</code></pre>

<p>So basically I create filters with select elements of different ids in each of many but the data population and change events are similar. So I wanted to create an API something like this:</p>

<pre><code>new Filter({ele1:$("#s1"), ele2:$("#s2"), ele3:$("#s3"), ele4:$("#s4")})
</code></pre>

<p>This filter should handle the population and its change events.</p>

<pre><code>function Filter(map)
{
   this.ele1 = map.ele1.id;
   this.ele2 = map.ele2.id;
   //similarly for all the other elements.

   this.e1e1.change(function(){
       //these elements uses selectors of other elements So how can I access the ele2, ele3 and so on...
   });
}
</code></pre>

<p>The problem here is the change events should be able to access the other variables ele2,ele3 of the filter object. </p>
