jquery의 힘을 ...JQuery 두 선택 항목을 함께 추가하십시오.
두 개의 선택을 함께 추가하려고하는데, 둘 다 같은 유형의 요소 (<option>
)를 포함합니다.
하지만 add(..)
방법은 공을 내고있는 것 같지 않습니다.
var matchingRemovedOptions = removedOptions.filter(function() {
return this.text.toLowerCase().match(str.toLowerCase());
});
tempOptions.add(matchingRemovedOptions);
console.log(tempOptions.length);
console.log(matchingRemovedOptions.length);
im은 removedOptions 선택에서 일부 옵션 요소를 필터링하고이를 tempOptions 선택 항목에 추가하려고합니다.
그러나 console.log를 사용할 때 tempOptions의 길이는 in과 같아도 증가하지 않습니다.
나는 믿을 수 없다. 내가이 코드를 다시 보았을 때이 메시지를 게시하는 즉시 나에게 떠올랐다. – Mike
항상 방법 :) –