javascript - Give focus to browser -


i'm working on keyboard accessibility. have flash object sits inside page, , stop focus getting trapped inside it, i've added tab listeners talk through externalinterface javascript functions.

the javascript looks next available element tabindex , calls focus() on it. far good. if plugin last tabbable item on page (or first when reverse-tabbing), there no element switch to. set focus browser window, i'd keep behaviour.

hence question: possible programatically give focus browser's chrome? better if can mimic both forward and backward tabbing. i'd avoid adding tabbable components before/after flash if possible, unless can make them invisible both mouse and keyboard.

setting focus dummy anchor no text content, @ top of document, seems work:

document.getelementsbytagname('a')[0].focus(); 

http://jsfiddle.net/4na5u/1/.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -