I have a quite specific query, how can I find all elements with a certain attribute.
My elements have attributes which follow a specific pattern, here are some examples:
<div data-jtemplate-href="x"></div>
<span data-jtemplate-text="x"></span>
<input data-jtemplate-something="x"/>
<table data-jtemplate-else="x"></table>
as you can see, all my elements have attributes where the name has the prefix ‘data-jtemplate’, how can I find all elements with the attribute prefix data-jtemplate?
Create your own expression, see http://jsfiddle.net/6pCh4/
this expression will filter all elements with a
data-jtemplate-*attribute (As you can see in the fiddle I’ve added another element that was correctly discarded by this filter)Of course this is customizable with other
data-*attribute (just changejtemplatein the selector)