1

I have many input elements in my page which are like ( simplification) :

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

I need to select all elements that has dataattributes which starts with data-mx-*

Apparently using this : won't help :

enter image description here

eg :

$(".tb").filter(function (){return $(this).is('[name^="value"]');}).data(); // we can't use it here

Question

How can I do it in the most effective way ?

nb It should be cross browser solution (ie8+) , performance is important.

Royi Namir
  • 144,742
  • 138
  • 468
  • 792

0 Answers0