Calling a javascript function multiple times
<p>I have a couple of those:</p>

<pre><code>        &lt;div class="enunt"&gt;text here&lt;/div&gt;
        &lt;div class="ans"&gt;&lt;input type="text" id="amount1" style="border: 0; color: #f6931f; font-weight: bold;" /&gt;&lt;/div&gt;
        &lt;div id="slider1" class="slide"&gt;&lt;/div&gt;
</code></pre>

<p>The others have the same structure, but the ids differ by their index number. And I need a function to set up the JQuery sliders. What I did is this:</p>

<pre><code>            function slider(i) {
                $( '#slider' + i ).slider({
                    value:4,
                    min: 1,
                    max: 7,
                    step: 1,
                    slide: function( event, ui, i ) {
                        $( '#amount' + i ).val( ui.value );
                    }
                });
                $( '#amount' + i ).val( $( '#slider' + i ).slider( "value" ) );
            }
</code></pre>

<p>And call it like so:</p>

<pre><code>for (var i=1; i&lt;6; i++)
    slider(i);
</code></pre>

<p>This does not work at all. Where is my mistake ? It's my first JQuery app, so please be nice.</p>
