By focus, I don't just mean scroll to that section of the page. Is there a way to make the browser behave as if the user had clicked on that div
? The use case here is that I want a user to be able to scroll in a div using the arrow keys
, but the div
appears on the click of another button which does not click the div
itself, so attempting to scroll with the arrow keys
does nothing since the main page is not scrollable
and is "focused"
by default. Obviously the .focus
function does not work on divs so I am wondering how to do this!
- This is NOT the same question as the one that it was marked as a duplicate of. There are links to similar questions in the answers to this one but currently this is marked as a duplicate of the wrong question