menu_book Course Curriculum (Web Development How-To) expand_more
Page Patterns
Forms & Interaction
Data & Network
Focus restoration
Learn Focus restoration in Web Development How-To with a focused explanation, a topic-specific example, and a mastery check.
12 min read
•
Intermediate
Advertisement
web-how-to-029.html
html
<button id="launch">Open panel</button><dialog id="panel"><button id="done">Done</button></dialog><script>let previous;launch.onclick=()=>{previous=document.activeElement;panel.showModal()};done.onclick=()=>{panel.close();previous?.focus()}</script>
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content