I want to be able to select a div based on the presence of a span element that has an attribute.
<div>
<a>blabla</a>
<p>blabla></p>
<span data-stackoverflow="hello"></span>
<img>blabla</img>
</div>
How do i do that?
How is this question the same as the question this question's supposed to be a duplicate of? That question is about elements that hold certain attributes on which the elements are selected.
I want to be able to select a DIV based on a CHILD SPAN!! that has an attribute!!
edit
$( "div" ).has( 'span[data-stackoverflow="' + somevalue+ '"]' ).show();
This one workes for me however in some occasions it affects other div's as well.