Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select all not disabled input buttons

Can I in some way select all input submit elements that are not disabled?

I can easily find all the disabled ones with: http://api.jquery.com/disabled-selector/

$("input.saveitembtn:disabled")

but is there something a'la:

$("input.saveitembtn:NOTdisabled")

My solution until now is to run through them all with jQuerys .each using .is to check each one individually:

$("input.saveitembtn").each(function(a){
  if( !$(this).is(':disabled') ) {
    ...
  }
});

which I find as total overkill. Is there a simple selector in jQuery?

like image 561
Steeven Avatar asked Apr 06 '13 19:04

Steeven


1 Answers

Yes, there is :not()

$("input.saveitembtn:not(:disabled)")
like image 157
palaѕн Avatar answered Nov 01 '22 08:11

palaѕн