I have the following html. How would I change the css for inner div that is within the outer div with id 'outerDiv1' and a class called Class1 is applied to outer div? In the page, there are multiple such outerdiv/innerdiv combinations, but in each case the outer div has a different id.
HTML
<div class="Class1 Class2" id="outerDiv1" >
<div class="raDiv" style="position: fixed; background-position: 420px 427px;></div>
</div>
<div class="Class1 Class2" id="outerDiv2" >
<div class="raDiv" style="position: fixed; background-position: 420px 427px;></div>
</div>
I tried the following jQuery code, but it doesn't seem to work.
jQuery to change a specific inner div CSS
$("#outerDiv1 .Class1 .raDiv").css("backgroundPosition", "420px 600px");
.Class1as it is not inside#outerDiv1or remove the space between#outerDiv1and.Class1as#outerDiv1.Class1. Also make sure you are doing things afterdocument.ready