I have several unknown elements (Could be span, input, select, div, whatever):
<div id="SomeControl" > <-- Data Attribute could be here
<span> <-- or Data Attribute could be here or even lower in the DOM
... somewhere here is a data attribute: data-is-dirty="True"
</span>
</div>
...
var $myControl = $('#SomeControl');
Using $myControl is there a way to find the existence and/or value of a given data attribute?
I've tried:
var isDirty = $myControl.find(':has([data-is-dirty]').data('is-dirty');
Any suggestions would be appreciated.