سؤال

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