Multiple selectors in jQuery

I am trying to run this code:

$("input[value='OK'][value='Recrutar'][value='Criar'][id!='attack_name_btn']").click();

So, as you can see, I'm trying to select an input that has a value of “OK” or “Recrutar” or “Criar”, and they may not have an identifier called “attack_name_btn”.

But it does not work.

I also did this, several jquery selectors

+5
source share
2 answers

Your code actually executes "and", not "or". You have a multiple attribute selector , but you need a multiple selector , and then filter the results of this.

+2
source

, , , , , :

$("input[value='OK'], input[value='Recrutar'], input[value='Criar']".filter("[id!='attack_name_btn']").click();
+3

All Articles