开发者

How do i find all drop down lists in a page using Jquery [closed]

开发者 https://www.devze.com 2022-12-09 22:11 出处:网络
开发者_如何学运维It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
开发者_如何学运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

How do i loop thru all dropdown boxes in JQuery?


something like this should do the trick

$("select").each(function() {
    //do something with the select $(this) will give you the select element
});


$("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(...)
0

精彩评论

暂无评论...
验证码 换一张
取 消