Are there any attributes or is there a way to indicate that two sections are a continuation of each other. Example below:
<section id="section-top">
<div>Item 1 </div>
<div>Item 2 </div>
</section>
<section id="section-bottom">
<div>Item 3 </div>
<div>Item 4 </div>
</section>
I need to keep things in separate sections because section-bottom is hidden until an expanding button is pressed. So when it displays, i need to indicate that its a part of the first list so that narrator reads 3/4 when you arrow down into item three instead of 1/2 because its in a separate section.
Is this possible?
The structure of your example HTML is not semantically correct, that said you can use
ariaroles and attributes to expose the intended meaning to screen-readers.Markup
Explanation
<section>elements in a<div>withrole=list.<div>withrole=listinside another<section>element, and use thearia-labelattribute to transform it into a region, and give it an accessible name.<section>elements have been given therole=presentationto negate the implicit role semantics but not affect the contents.<div>elements have been givenrole=listitem.hiddenattribute, and you will need to follow up yourself with the useful answer from codeMonkey on how you show/hide these.