使用jQuery选择具有特定模式的data- *的元素?

时间:2014-08-18 07:36:05

标签: jquery

我的页面中有很多输入元素,如(简化):

<input  class='tb' data-mx-a1="dummyA"  
                   data-mx-b20="dummyB" 
                   data-mx-c99="dummyC" />

我需要选择具有启动的数据属性的所有元素data-mx-*

显然使用这个:不会有帮助:

enter image description here

例如:

$(".tb").filter(function (){return $(this).is('[name^="value"]');}).data(); //我们不能在这里使用

问题

我怎样才能以最有效的方式做到这一点?

nb应该是跨浏览器解决方案(ie8 +),性能很重要。

0 个答案:

没有答案
相关问题