How can I target an HTML element that has a specific attribute, but when that attribute has no value (well, whether it has a value or not). I've found others asking similar questions about elements with attribute values but not based on existence of the attribute itself.
For example, with this HTML:
<div id="id1">
<div class="c1"></div>
<div class="c2" an-attribute ></div>
<div class="c3"></div>
</div>
How might I go about finding the div within #id1 that has the attribute an-attribute? I can't count on it being in a particular location related to the other divs but can count on it being in #id1.
$('#id1 *[an-attribute]');