Let\'s say I have a document full of focusable elements, either because they are innately focusable (like ) or because they have
The jqModal jQuery plugin does this out of the box by setting the modal option to true. The examples on this page with forms should show it. I remember going through the code to see what was happening and you could do it quite easily with plain JS.
modal