I have the following marking:
<div class="step-content">
<div id="step-1">
<h1>step 1</h1>
<h1>step 1</h1>
</div>
<div id="step-2">
<h1>step 2</h1>
<h1>step 2</h1>
</div>
<div id="step-3">
<h1>step 3</h1>
<h1>step 3</h1>
</div>
</div>
In this example I need to select only the elements #step-1
, #step-2
and #step-3
to set display:none
to each of them and not to their relative ( .step-content
).
Above I used
div
andid
sequential, but the selector should not depend on the type of element (div
,section
,p
and etc) and neither itsid
orclass
Which selector should I use to select all the first nodes that are children of .step-content
independent of the HTML element?