문제

I need to select form elements and limit the list to elements that are both visible and enabled.

The following works:

myInputs.filter(':visible').filter(':enabled');

This does not (it does not remove disabled elements):

myInputs.filter(':visible, :enabled');

Is there a better way to combine these two filters?

도움이 되었습니까?

해결책

Remove the comma from that selector to make your concept working.

Try,

myInputs.filter(':visible:enabled');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top