1

I have this html code:

<div data-r-foo="mfoo" data-r-bar="mbar"></div>
<div data-r-zoo="mfso"></div>
<div data-r-too="too" data-r-foo="mfoo"></div>

now I want to select all elements with data-r* and the elements they have multiple data-r* like first element and last element must be selected once. I have tried this but my IDE shows a syntax error

$('[data-r*]');
Pejman
  • 2,442
  • 4
  • 34
  • 62
  • Anybody know the answer for this question I am willing to know the answer – Sudharsan S Jul 09 '15 at 15:34
  • 1
    @RodrigoDela It's not my purpose, I want to select every nodes with `data-r*` attrib – Pejman Jul 09 '15 at 15:36
  • And here's another duplicate: http://stackoverflow.com/questions/26657398/jquery-how-to-select-value-by-attribute-name-starts-with And one more: http://stackoverflow.com/questions/10313312/how-to-get-all-html-attributes-which-start-with-something-the-attribute-names –  Jul 09 '15 at 15:38
  • Why is this being reopened when it's a clear duplicate? –  Jul 09 '15 at 15:39
  • 1
    @tymeJV: He wanted a prefix match of the name. That'll only give an exact match. –  Jul 09 '15 at 18:11

0 Answers0