[jQuery] Looping not working for selectors?

[jQuery] Looping not working for selectors?


Dear friends,
I am a newbie to jQuery and more so for javascript.
Please pardon my ignorance.
I am wondering why this code does not work.
for(i = 0; i < 10; i++) {
    $('.treeview:eq(' +i+ ')').click(function() {
        $('.monitor:eq(' +i+ ')').trigger('click');
    });
}
Since this did not work I had to manually loop thro' them...
I also tried the variable approach.
var selector = '.treeview:eq(' +i+ ')';
    $(selector)....
What is going on?
Many thanks in advance for the help.
-Girish