I’m sure this is an easy one but I’ve not had to write this syntax before and i cant find an answer online!
I have a various graph sliders within a html page – each have the below code –
<div class="sliderDbWk">
<div class="spanner">
<div class="number">
<span class="timer"> </span>
<Span class="timerPc">%</Span>
</div>
</div>
</div>
Each parent class is different (ie sliderDbMnth, sliderDbCal), i pass in to a function the sliders parent class and want to target the child .number div within this – so the parent class is stored as a variable – I’m not sure how to combine a variable and a class name in a function – i’ve tried below – but it doesn’t work!
Any ideas?
$(sliderSelect).children(' .number').css('margin-left',0);
It should be
.find('.number'), notchildren('.number')– as you start your search from ‘.sliderSomething’ element, and<div class="number">is its grandchild. Quoting the doc: