Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get element that does not start with particular name

Tags:

jquery

$('[name^="field_"][type="checkbox"]');

Above gives the list of checkboxes with name that start with field_.

How can I get all the checkboxes that does not start with field_

Any help is appreciated.

like image 319
Kurund Jalmi Avatar asked Nov 01 '11 12:11

Kurund Jalmi


2 Answers

$('[type="checkbox"]:not([name^="field_"])');
like image 55
Manuel van Rijn Avatar answered Sep 20 '22 09:09

Manuel van Rijn


Lets say we want all "a" tags which do not have class starting with "comment". This is what you will call

$('a:not([class^="comment"])')
like image 41
spicavigo Avatar answered Sep 21 '22 09:09

spicavigo