jquery选择器,它查找具有多个值之一的属性的元素

时间:2010-12-28 21:31:13

标签: jquery

我需要一个jquery忍者来帮助我找到最好的jquery选择器来解决我的需求:

// pseudo jquery selector:
var match = $('table[facet=ProductCateogory or ProductCatagoryTier2 or DocumentCategory]')


// this would not match:
<table facet="EiaBrand"

// this would match:
<table facet="ProductCategory"

1 个答案:

答案 0 :(得分:3)

我认为你必须使用multiple selector ,分别指定它们:

var match = $('table[facet=ProductCateogory],table[facet=ProductCatagoryTier2],table[facet=DocumentCategory]')