How do set select element array index when it is in array and bind to blur event
<p>I have array of select dom and input textbox . On  blur event of input(of perticular index) want to set the element in select dom value of same index. </p>

<p>My bind is working but after each blur event for different input box it is retiurning 0.</p>

<p>I am not able to set the select value i.e. (drop down)as per given index </p>

<p><a href="http://jsfiddle.net/kamleshahire/BwMnw/" rel="nofollow">JSFiddle</a></p>

<p>My code is following.</p>

<pre><code>$(document).ready(function (){
    var i =1;
    $('#addme').on('click', function(){

        var  test = '&lt;tr class="employee"&gt;&lt;td&gt;&lt;input type="text" id="emp_id['+i+']" /&gt;&lt;/td&gt;&lt;td&gt;&lt;select id="emp_name['+i+']" '
        test += '&lt;option value="-1" &gt;Please Select &lt;/option&gt;&lt;option value="e0001" &gt;James Smith&lt;/option&gt;&lt;option value="e0002" &gt;Roger Sm&lt;/option&gt;'  
        test +='&lt;option value="e0003" &gt;Elina Lobo&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;'   

        $('#addme').after(test);
        i++;
    });

    $(".employee input").live('blur',function(){
        var inputIndex = $(this).index();
        var inputValue = $(this).val();
        alert("Input Index is :" +  inputIndex + ' and value is ' + inputValue);

        $('#emp_name[inputIndex]').each(function(){
            if(this.value == inputValue){
                $('#emp_name[inputIndex]').val($(this).val()); 
                    return false;
            }
            alert("Please iput valid value");
            $('#emp_name[inputIndex]').val('-1');
        });
    });
});
    &lt;/script&gt;
    &lt;table /&gt;
    &lt;tr class="employee"&gt;
        &lt;td&gt;&lt;input class="employee" type="text" id="emp_id[0]" /&gt;&lt;/td&gt;
        &lt;td&gt;&lt;select id="emp_name[0]" name="emp_name"&gt;
            &lt;option value="-1" &gt;Please Select &lt;/option&gt;
            &lt;option value="e0001" &gt;James Smith&lt;/option&gt;         
            &lt;option value="e0002" &gt;Roger Sm&lt;/option&gt;
            &lt;option value="e0003" &gt;Elina Lobo&lt;/option&gt;
        &lt;/select&gt;&lt;/td&gt;
    &lt;/tr&gt; 

    &lt;input type="button" id="addme" value="ADD ME"/&gt; 

  &lt;/body&gt;
 &lt;/html&gt; 
</code></pre>

<p>Thanks in advance</p>
