Prerequisite lessons
The pattern
The product grid and status pattern
Each card owns its controls. The collection owns its list. One status region owns cart feedback.
Keyboard-testable shop
Three products, six useful stops.
Cart: 0 items
Weather shell
$156
Boot linkBoot addPack linkPack addShell linkShell add
Composition
Keep responsibility local.
A shared live region should announce a complete result such as product plus quantity. Do not place a live region in every card or move focus to the cart count.
Collection and cards
List structure surrounds independent product articles.
<ul class="products">
<li><article>…title link…add button…</article></li>
</ul>One persistent status
The full message updates without receiving focus.
<p role="status" aria-atomic="true">Cart: 0 items</p>
status.textContent = `Cart: ${count} items. ${product} added.`;Quick test
Multiply your checks too.
- Confirm the collection is announced as a list with the expected number of items.
- Confirm each product title is a heading link and each image is absent from tab order.
- Confirm every Add to cart name includes its product.
- Add each product and listen for product name plus updated cart quantity.
- Confirm focus stays on the button during and after its request.
- Resize the grid and confirm DOM, reading, and focus order remain aligned.