Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Read a Page With VoiceOver and NVDA

In this video, you read the choir’s home page the way Tomás’s screen reader does, one item at a time, and typed into the sign-up form.

The video can’t play a screen reader, so it shows what one reads, the browser’s accessibility tree, and the keys you press. To hear it, turn on your own screen reader and follow along.

Key Points

  • Turn VoiceOver on. On a Mac, VoiceOver is built in: Cmd+F5 turns it on and off. The first time, press Enter in its welcome dialog to keep it on, since Esc there turns it off again. Its commands start with the VoiceOver key, VO, which is Ctrl+Option held together.
  • Or turn on NVDA. On Windows, NVDA is free from NV Access. Once it’s installed, Ctrl+Alt+N starts it. Its commands use the NVDA key, which is Ins by default, or Caps Lock if you tick that option in NVDA’s welcome dialog.
  • Silence the speech. In both readers, Ctrl silences the speech. In VoiceOver, a second press picks it up again.
  • See what a screen reader reads. Inspect the page, open the Accessibility tab, and turn on the Show accessibility tree switch at its top. The Elements panel then shows the accessibility tree instead of the HTML. It has one row for each thing a screen reader can read, with its role and name, in source order. The top row is the page itself, named by its <title>. The text rows under each item hold the words it’s read with.
  • Watch in Chrome, listen where you test. Watch the order in Chrome’s tree, and listen in the browser you test with, often Safari for VoiceOver. Both read the same HTML.
  • Start at the top. Click the page itself, not DevTools. If NVDA starts reading on its own, press Ctrl. Then go to the top: Ctrl+Home in NVDA, or Ctrl+Option+Home (VO and Home, or Ctrl+Option+Fn+Left on some keyboards) in VoiceOver.
  • Read item by item. Each press of Ctrl+Option+Right (VO and Right Arrow) in VoiceOver, or Down in NVDA, moves on and reads what it reaches. On the home page, that’s a link named Skip to main content, a link named Larkfield Community Choir inside the banner landmark, then the navigation landmark and its list: links named Home, Rehearsals, Concerts and Join.
  • Presses and rows may differ. A reader often announces a landmark or list with the first item inside, so presses and rows may not match one for one.
  • Source order wins. Join is drawn first, but it’s last in the source, so it’s read last. Then come a heading, level 1, named Singing together in Larkfield since 1987, in the main landmark, and the paragraph’s text.
  • That reading position is the virtual cursor. VoiceOver moves item by item and NVDA line by line, but both follow the tree’s order. In NVDA, reading this way is called browse mode.
  • Watch out: Tab moves only between controls. In Chrome, it goes from the nav links straight to See the program and dates, under News, past the heading and the paragraph. In Safari, Tab skips links as well, unless you turn on Press Tab to highlight each item on a webpage in Safari’s Advanced settings. Either way, text is never a Tab stop. Tomás reads text with the virtual cursor, so it never needs a tabindex.
  • Type in a field. A field is a control, so Tab reaches it. On the sign-up form, the first field is a textbox named Your name, required.
  • Focus mode in NVDA. In NVDA’s browse mode, a letter you type is a reading command, not text. So when Tab lands on a field, NVDA switches to focus mode and your keys go to the field. If you arrow onto a field instead, press Enter. Press Esc to go back to browse mode and read again. VoiceOver has no mode to switch, so after Tab you can type right away.
  • Read on. Ctrl+Option+A (VO and A) or Ins+Down (the NVDA key and Down Arrow, or NVDA and A in NVDA’s laptop layout) reads on without a key press per item. Reading stops when you press Ctrl.
  • The rule: a screen reader moves through the accessibility tree in source order, one item at a time, and gives each item’s role, name and state.

The Final Code

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

00:00 Tomás has told Marjorie he can’t find the choir’s rehearsal schedule. You’ve checked names one element at a time. In this video, you’ll read a whole page the way his screen reader does.

00:12 This video can’t play a screen reader. It shows what one reads, the browser’s accessibility tree, and the keys you press. To hear it, turn on your own and follow along.

00:24 On a Mac, VoiceOver comes built in. Command and F5 turns it on and off. Its commands start with the VoiceOver key, Control and Option held together.

00:35 On Windows, NVDA is free from NV Access. Once it’s installed, Control, Alt and N starts it. Its commands use the NVDA key, which is Insert by default. In both readers, Control silences the speech.

00:51 In VoiceOver, a second press picks it up again.

00:56 Open the home page and inspect it. Open the Accessibility tab. Its Show accessibility tree switch is at the top. Turn it on. The Elements panel now shows the accessibility tree instead of the HTML.

01:10 Each row is one thing a screen reader can read, with its role and name. The rows come in source order. The top row is the page itself, named by its title. The text rows under each item hold the words it’s read with.

01:27 First, click the page itself, not DevTools. If NVDA starts reading on its own, press Control. Then go to the top: Control and Home in NVDA, or the VoiceOver key with Home.

01:41 The reader lands on a link named Skip to main content. Each press of the VoiceOver key with Right Arrow, or Down Arrow in NVDA, moves on and reads what it reaches.

01:53 Next comes a link named Larkfield Community Choir, inside the banner landmark, the header. A reader often announces a landmark or list with the first item inside, so presses and rows may not match one for one.

02:07 Then the navigation landmark and its list: links named Home, Rehearsals, Concerts and Join. Join is drawn first, but it’s last in the source, so it’s read last.

02:20 In the main landmark comes a heading, level 1, named Singing together in Larkfield since 1987. Then comes the paragraph’s text. VoiceOver moves item by item, and NVDA line by line, but both follow this order.

02:37 That reading position is the virtual cursor. In NVDA, reading this way is called browse mode. Watch out: Tab moves only between controls. In Chrome, it goes from the nav links straight to See the program and dates, under News, past the heading and the paragraph.

02:55 Tomás reads text with the virtual cursor, so it never needs a tabindex.

03:01 A field is a control, so Tab reaches it. On the sign-up form, press Tab until you reach the first field. The tree shows a textbox named Your name, required.

03:13 In NVDA’s browse mode, a letter you type is a reading command, not text. So when Tab lands on a field, NVDA switches to focus mode, and your keys go to the field.

03:25 Type Tomás. Press Escape to go back to browse mode and read again. VoiceOver has no mode to switch, so after Tab you can type right away.

03:37 To read on without a key press per item, press the VoiceOver key and A, or the NVDA key and Down Arrow. Reading stops when you press Control. Here’s the rule: a screen reader moves through the accessibility tree in source order, one item at a time, and gives each item’s role, name and state.

03:59 Reading every item is slow, even here. Tomás wants the rehearsal schedule, not every link in the header. Next comes Jump by Headings, Landmarks and Links, where you’ll find it the way he would.

Become a Member to join the conversation.