Is there a way to find all the elements with attributes that start with a particular string?
I am using Mootools framework and this is what I have tried:
$$('*[data-media-*]');
But it just outputs all the elements in the page.
So is there a way to get all the elements in the page that have attributes that start with, data-media-?
you can filter elements that you already have to return ones with matching data-* attributes.
in action: http://jsfiddle.net/dimitar/pgZDw/
downside: you already need to pass it on a collection of elements that make sense, eg. div.foo or #someid *
a more elegant solution would be to add a
:data()pseudo to Slick:updated example: http://jsfiddle.net/dimitar/pgZDw/3/