Minimal code: status region + updater
<!-- Results count / status (always present) -->
<div id="statusMsg" role="status" aria-live="polite" aria-atomic="true">
Showing 15 of 15 items
</div>
<!-- Keep updates simple: replace textContent; don't move focus -->
<script>
function updateStatus(shown, total) {
const msg = shown === 0
? `No items match (${total} total)`
: `Showing ${shown} of ${total} items`;
document.getElementById('statusMsg').textContent = msg;
}
</script>
The statusMsg region is always present in the DOM and updated directly (not via innerHTML).