0

Is it possible to select the elements of a type that contains element with a determined class?

Example:

<div class="myLabel"">
     <label class="PageTitle" tabindex="-1">en la san fan the la patriki</label>
</div>  
<div class="myLabel"">
     <label tabindex="-1">other san fanes</label>
</div>  

I want the first div to be returned but not the second. Something like this:

 div.myLabel:haschild([class*="PageTitle"])
Huangism
  • 16,278
  • 7
  • 48
  • 74
Adminiculo
  • 303
  • 1
  • 14
  • Can't do it with css currently, not reliably at least – Huangism Sep 29 '14 at 18:52
  • Not yet... Try Js. Take a look at JQuery `.has()` - http://api.jquery.com/has/ – LcSalazar Sep 29 '14 at 18:55
  • @Huangism I don't want to search the parents for set of given elements. I want discard some elements from a set I already have. But yes, maybe these are the both sides of the same coin. – Adminiculo Sep 29 '14 at 18:58
  • @Adminiculo yes same thing, you can't modify the parent based on its children using css reliably – Huangism Sep 29 '14 at 19:01
  • @LcSalazar I was hoping to solve the matter only editing the styles file. Running a script would fix it but it would be hard to maintain. – Adminiculo Sep 29 '14 at 19:01

0 Answers0