Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select child element based on parent's attribute value

I'm looking for a css selector to select the inner div using the outerDivs class and data attribute. As I only want to be able to select the inner div if the data is set to true is this possible ?

<div class="outerDiv" data-Outer="true"> 
  <div class="inner"> </div>
</div>
like image 749
Ryan Holmes Avatar asked Feb 07 '23 08:02

Ryan Holmes


1 Answers

.outerDiv[data-Outer="true"] > .inner should do the trick.

like image 192
trysmudford Avatar answered Feb 10 '23 12:02

trysmudford