The focus needs to be set in addition to scrolling to the target. This is important for accessibility and is the default behavior when <a> is used.
You can test this with the free NVDA screen reader (use down arrow after activating the link to hear where the focus is). I found this project was a simple way to do a test with NVDA.
The focus needs to be set in addition to scrolling to the target. This is important for accessibility and is the default behavior when
<a>
is used.You can test this with the free NVDA screen reader (use down arrow after activating the link to hear where the focus is). I found this project was a simple way to do a test with NVDA.