I have faced the same issue while fetching elements using jQuery and data-* attribute.
so for your reference the shortest code is here:
This is my HTML Code:
<section data-js="carousel"></section>
<section></section>
<section></section>
<section data-js="carousel"></section>
This is my jQuery selector:
$('section[data-js="carousel"]');
// this will return array of the section elements which has data-js="carousel" attribute.