Jquery - $(this) in in nested loops

Posted by Smickie on Stack Overflow See other posts from Stack Overflow or by Smickie
Published on 2010-04-18T19:42:05Z Indexed on 2010/04/18 19:43 UTC
Read the original article Hit count: 611

Hi,

I can't figure out how to do something in Jquery. Let's say I have a form with many select drop-downs and do this...

$('#a_form select').each(function(index) {

});

When inside this loop I want to loop over each of the options, but I can't figure out how to do this, is it something like this....?

    $('#a_form select').each(function(index) {

        $(this + 'option').each(function(index) {
           //do things
        });
});

I can't quite get it to work, and advice? Cheers.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript