CKTIS / HTML
aria-current — the current item in a set
`aria-current` marks the current page, step, or another current item within a related set.
Version: WAI-ARIA 1.2
Syntax
<a href="/courses" aria-current="page">Courses</a>Allowed tokens are page, step, location, date, time, true, and false. Missing, empty, or undefined means not current; an unknown nonempty token is treated as true. Still choose a specific valid token.
Mark one item as current within a set. This is not a selected tab or keyboard focus: it does not replace aria-selected or navigate anywhere. Provide a visible indication that does not rely solely on color.
The example moves the marker from Home to Courses and removes the old one. It deliberately prevents navigation to demonstrate the update; in an application the marker must match the page actually displayed. The test confirms exactly one current link.
Examples
<!doctype html><meta charset="utf-8">
<nav aria-label="Sections"><a href="/" aria-current="page">Home</a> <a id="courses" href="/courses">Courses</a></nav>
<output id="result"></output>
<script>
const links = [...document.querySelectorAll('nav a')];
links.forEach(link => link.addEventListener('click', event => {
event.preventDefault();
links.forEach(other => other.removeAttribute('aria-current'));
link.setAttribute('aria-current', 'page');
}));
document.querySelector('#courses').click();
const current = document.querySelectorAll('[aria-current="page"]');
document.querySelector('#result').textContent = 'current=' + current[0].textContent + '; count=' + current.length;
</script>Result
current=Courses; count=1
The local demonstration does not open another page. It verifies marker movement, not a complete router.