2021-03-10 23:02:37

I'm looking to inspect HTML elements of a web page and extract their information such as IDs, classes, etc. This seems to work fine with interactive elements such as text fields, buttons, etc; however, text elements like headings, paragraphs, etc are not given proper focus when using NVDA/JAWS. What ways exist to target these elements and extrapolate their information?

What game will hadi.gsf want to play next?

2021-03-10 23:42:48

setting tabindex=-1 on those elements seems to work. You also have to sset Automatically set system focus to focusable elements to on in nvda, nvda+8.
With the risk of sounding like a broken record, web accessibilizer does this, shift+f2:
https://www.stsolution.org/WebAccessibilizer

2021-03-10 23:44:56

The question is about elements which can't be focused.  The fix is frequently as follows, assuming NVDA laptop layout:

Object navigate to the element, nvda+shift+m, NVDA+], find inspect in the context menu.

Doesn't work always, sadly.  If there's something in front of the element you get that instead.

Maybe there's a better way.  Web isn't my primary thing.

My Blog
Twitter: @ajhicks1992

2021-03-11 02:12:14

JAWS has a feature called Element Viewer that will do this. If you press JAWS + Shift + F1, it'll show a list of information about the element your cursor is focused on. My question has been answered but thought I'd share on here.

What game will hadi.gsf want to play next?

2021-03-11 03:46:46 (edited by nyanchan 2021-03-11 03:48:51)

Why -1? -1 disables tab indexing.
The easiest way I've found so far is to use firefox. Hit f12, Input the substring of the element you want to find into the search element box then enter. Chrome has the same feature, but it's somewhat confusing to me.

I don't speak as good as I write, and I don't listen as good as I speak.

2021-03-11 21:52:06 (edited by vortex1024 2021-03-11 21:54:20)

@3: exactly, and my solution works, at least in chrome. if the element has tabindex=-1, simply moving to it with arrows and clicking inspect element will focus that element, because the attribute makes any element focusable, even headings and paragraphs without links.
I am not sure why the value is -1, I just saw this trick somewhere else, and successfully tested it. It's true, it doesn't allow focusing with tab, but with arrows, it works.
@4, your solution is easier. Glad it works for you.