How do i loop thru all dropdown boxes in JQuery?
A:
something like this should do the trick
$("select").each(function() {
//do something with the select $(this) will give you the select element
});
Marek Karbarz
2009-11-03 01:26:35
or just, y'know, `$('select')`
Mark
2009-11-03 01:28:40
I realized my mistake, input didn't even work
Marek Karbarz
2009-11-03 01:29:23
Hos do I loop thru in multiple divs?Can I do $('#mydivname').find('select').each(function(){});??
Greens
2009-11-03 01:41:32
are you looking for something like this $("#mydiv select").each(...) ?
Marek Karbarz
2009-11-03 01:44:14
+1
A:
$("select")
will include all the combo boxes too. To just get the drop down menus, use this:
$("select:not([size])")
To answer your other question:
How do I loop thru in multiple divs? Can I do
$('#mydivname').find('select').each(function(){ });
??
$('#mydivname select:not[size]').each(...)
nickf
2009-11-03 01:42:26