jQuery中的多个选择器 [英] Multiple selectors in jQuery

查看:91
本文介绍了jQuery中的多个选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $(input [value ='OK'] [value = 'Recrutar'] [值= 'Criar'] [ID = 'attack_name_btn'])点击()!。 

因此,如您所见,我试图选择一个值等于 OK或Recrutar或Criar,它们可能没有一个名为attack_name_btn的标识。



但它不起作用。

我也是这样做的,多个选择器jquery

解决方案

你的代码实际上在做'和'而不是'或'。你拥有的是多重属性选择器,但是你想要的是多重选择器,然后过滤器的结果。


I'm trying to run this code:

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

So, as you see, I'm trying to select a input that has a value equal to "OK" or "Recrutar" or "Criar" and they may not have an id called "attack_name_btn".

But it's not working.

I ckecked this too, multiple selectors jquery

解决方案

Your code is actually doing an 'and' not an 'or'. What you have is the multiple attribute selector, but what you want is the multiple selector and then filter the results of that.

这篇关于jQuery中的多个选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆