Focus Trapper Demo

The "trapped" attribute

Click the button to toggle the trapped attribute.

Two

Dynamically add elements

This demo has focus trapping enabled by default. Click the button to add new elements after the page has loaded.