performance issue with code. please suggest

performance issue with code. please suggest

I am using the below code in my program but it seems that these few line of code is taking too much time to execute. For 100 iteration it is consuming 1 mins approx. for 200+ iteration my broser is showing a warning message that script is taking too much time. Please suggest.

arr is an array cosists of div ids.Outerdiv is the the parent div of all these div ids present in arr array. arr ids cannot be accessed directly, it has to be referenced using the parent div outerDiv.

for(var i=0;i<arr.length;i++)
                {
                    $("#"+outerDiv+"> div[id="+arr[i]+"]").attr("class","selected");
                }