2009-10-06 1 views

답변

2
var selects = $('select').filter(function() { 
    return $(this).find('option').length === 2 
}); 

나 :이 또한 것이다

var selects = $('select').filter(function() { 
    return $('option', this).length === 2; 
}); 
3

작동 :

$('select:has(option:first-child + option:last-child)'); 

을 기본적으로는 첫 번째 자식이며 인접 인 option 요소를 포함하는 select 요소를 찾습니다 마지막 자식 인 option

+0

좋은 생각이 들지 않았습니다. –