check whether your selector is returning the items or not.
just check the length of $('.treeview').
selectors will search on the document tree only. If you create those
elements
in the javascript and did not append to dom tree, the selector does not
return the required result.
On Thu, Oct 23, 2008 at 9:39 AM, Girish Venkatachalam <
[EMAIL PROTECTED]> wrote:
>
> 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
>