Consider following snipped code:
<div id="sample">
<div es-value="true" />
.....
<span es-change="false" />
</div>
How can I get all elements that have attribute that it's name begins with "es-"?
Consider following snipped code:
<div id="sample">
<div es-value="true" />
.....
<span es-change="false" />
</div>
How can I get all elements that have attribute that it's name begins with "es-"?
I didn't test it but this should work:
jQuery.expr[':'].contains = function (a, i, m) {
var elementList = [];
$.each(jQuery(a).attr(),function(index,attribute)
{
if(attribute.toUpperCase().indexOf(m[3].toUpperCase()) >= 0)
{
elementList.push(attribute);
}
});
return elementList;
};
$.find('div:contains(''es-'')');