How can I pass the id to the function in the following javascript code?
for(var i = 1; i<=10; i++){     
    var id = i;
        $("#result-" + id).click(function(event){
        makeFeatureSelected(id, true);
    });
}
In this way, the value of id is always 11.
Thanks.
 
     
     
     
    