【发布时间】:2010-04-19 03:53:55
【问题描述】:
我不知道如何在 Jquery 中做某事。假设我有一个包含许多选择下拉列表的表单并执行此操作...
$('#a_form select').each(function(index) {
});
在这个循环中,我想遍历每个选项,但我不知道该怎么做,是不是像这样......?
$('#a_form select').each(function(index) {
$(this + 'option').each(function(index) {
//do things
});
});
我不能让它工作,有什么建议吗?干杯。
【问题讨论】:
标签: javascript jquery css-selectors each nested-loops