JS – Apply style to parent if it has child with css

Standard
I’m ContentRow and only 50px

if($(‘#ContentRow’).hasClass(‘row Blue’)) {
$(“body”).addClass(“Blue”);

}

body {
background-color:red;
}

#ContentRow {
height:50px;
position:relative;
border:1px solid #000000;
}

.Blue {
background-color:blue;
}

.row {
color:red;
}

Leave a comment