using variable extracted from selector
<p>I am trying to use list elements to toggle between corresponding panels, I also want to do this using variables, just so I can orient myself with their use better. Here is my html and code below. I am tring to extract the i from the the "icon" id clicked, and use that i to open a corresponding "panel" id, with the attached i afterward. Any help would be appreciated! thanks!</p>

<p>html</p>

<pre><code>&lt;div id="icon0" class="icon"&gt;
                    &lt;a href=""&gt;&lt;img src="Images/film_icon.png"/&gt;&lt;/a&gt;
                    &lt;/div&gt;
&lt;div id="icon1" class="icon"&gt;
                    &lt;a href=""&gt;&lt;img src="Images/film_icon.png"/&gt;&lt;/a&gt;
                    &lt;/div&gt;
&lt;div id="icon2" class="icon"&gt;
                    &lt;a href=""&gt;&lt;img src="Images/film_icon.png"/&gt;&lt;/a&gt;
                    &lt;/div&gt;
&lt;div id="icon3" class="icon"&gt;
                    &lt;a href=""&gt;&lt;img src="Images/film_icon.png"/&gt;&lt;/a&gt;
                    &lt;/div&gt;
</code></pre>

<p>html panels:</p>

<pre><code>&lt;div id="panel0" class="panel"&gt;0000&lt;/div&gt;
                    &lt;div id="panel1" class="panel"&gt;1111&lt;/div&gt;
                    &lt;div id="panel2" class="panel"&gt;2222&lt;/div&gt;
                    &lt;div id="panel3" class="panel"&gt;3333&lt;/div&gt;
</code></pre>

<p>Jquery</p>

<pre><code>for(var i=0; i&lt;4; i++){
        $('#icon'+i).click( function() {  
        $('#panel'+i).fadeOut(400);
        return false;
</code></pre>
